I searched for this, but cannot find exaclty what I am looking for. I am trying to dynamically create labels on a form just before it opens. I am reading from a database, building the labels then opening the form.
Currently I have put the labels (in a control array) on the form I want to receive the variables. Then I create a loop to read in the db and build the labels, then open the form.
I have like 300 control arrays to build, and would love to dynamically create everything.
the code I have thus far is:
Expand|Select|Wrap|Line Numbers
- While Not rs.EOF
- If IsNull(rs("Eclient")) = False Then
- frmClientStatus.lblClient(i).Caption = rs("Eclient")
- End If
- Load frmClientStatus
- With frmClientStatus
- .lblTestClient (i)
- .Left = "500"
- .Top = "500"
- .Caption = "test"
- .Visible = True
- End With
- If IsNull(rs("InforceDate")) = False Then
- frmClientStatus.InforceDate(i).Caption = rs("InforceDate")
- End If
love to hear any ideas - thanks a mil.
Mark