cab7e6bd

Public Function funRestoreFormControls(frm As Form) As Boolean


Dim ctl As Control, rst As Recordset, dbs As Database, i As Integer

On Error GoTo 999 '

funRestoreFormControls = False '

Set dbs = CurrentDb '

Set rst = dbs.OpenRecordset("SELECT * FROM [-]")

If rst.RecordCount = 0 Then '

rst.Close '

Exit Function '

End If

With rst '

.MoveLast '

.MoveFirst ' 1



For i = 0 To .RecordCount - 1 '

Select Case rst!ControlType

Case acCommandButton '

Set ctl = appAccess.CreateControl(frm.Name, rst!ControlType, , "", "", rst!Left, rst!Top, rst!Width, rst!Height)

ctl.OnClick = "[Event Procedure]" '

ctl.Caption = rst!Caption '

ctl.ControlTipText = rst!ControlTipText '

Case acLabel '

Set ctl = appAccess.CreateControl(frm.Name, rst!ControlType, , "", rst!Caption, rst!Left, rst!Top, rst!Width, rst!Height)

ctl.BackColor = !BackColor '

Case acTextBox '

Set ctl = appAccess.CreateControl(frm.Name, rst!ControlType, , "", "", rst!Left, rst!Top, rst!Width, rst!Height)

ctl.SpecialEffect = 0 '

ctl.BorderColor = 0 '

ctl.BorderStyle = 1 '

Case acListBox '

Set ctl = appAccess.CreateControl(frm.Name, rst!ControlType, , "", "", rst!Left, rst!Top, rst!Width, rst!Height)


ctl.SpecialEffect = 0 '롨ࠥ ⠭⭮ 뤥

ctl.BackColor = rst!BackColor '塞 䮭 ᯨ᪠

ctl.BorderColor = 0 '롨ࠥ ⠭⭮ 뤥

ctl.ColumnCount = 2 '⠭ ᫮

ctl.ColumnWidths = "7,932 ;1 " '⠭ ࠧ

ctl.RowSource = "ᑯ᮪" ' 롨ࠥ ᯨ᪠

End Select

ctl.Name = rst!Name '塞

ctl.ForeColor = !ForeColor '塞 梥 ᨬ

rst.MoveNext '室 ᫥

Next i

End With

rst.Close '뢠



funRestoreFormControls = True '頥 १

Exit Function '室 ணࠬ

999:

MsgBox Err.Description '頥 訡

Err.Clear '頥 ⮪ 訡