|
Static p(21) As Control, q(21) As Control, i As Integer
Dim MySet As recordset
Dim mydb As Database
Set mydb = DBEngine.Workspaces(0).Databases(0)
Set MySet = mydb.OpenRecordset("print_prepare")
Dim control_left As Integer
control_left = 2000
MySet.MoveFirst
i = 3
Do Until MySet.EOF
i = i + 1
If MySet!table_name = "table_name" Then
If MySet!yes_no = True Then
p(i).Visible = True
p(i).ControlSource = MySet!field_name
q(i).caption = MySet!field_desc
q(i).Visible = True
p(i).width = MySet!control_width
p(i).Left = control_left
q(i).width = MySet!control_width
q(i).Left = control_left
Else
p(i).Visible = False
p(i).ControlSource = ""
q(i).Visible = False
p(i).width = 0
p(i).Left = control_left
q(i).width = 0
q(i).Left = control_left
End If
control_left = control_left + MySet!control_width
End If
MySet.MoveNext
Loop
MySet.close
希望上面代码能够给你启发。 |
|