G
Guest
I am having trouble with referencing labels on a form. I need to be able to
address about 120 labels on a form On_Activate and change the caption of each
based on a user's preference stored in a table. The table is:
UserName (Each user has specified templated text that goes into the text
box)
Button Name (refering to the label name on the form)
Button Caption (The new caption to replace the existing caption)
Text (Text to be inserted into the label's associated text box when
clicked by user)
I have attempted to do this in this way (Debug.print used to test the code
to see what works and what doesn't):
Do Until rst.EOF
Debug.Print "rstBN="; rst.Fields("ButtonName") 'This works fine...
BN = rst.Fields("ButtonName")
Debug.Print "BN="; BN 'This works fine also...
Debug.Print Me.BN 'This doesn't work...
Debug.Print Me.BN.Caption 'Nor does this...
BC = rst.Fields("ButtonCaption") 'Nor this...
Debug.Print "rstBC="; rst.Fields("ButtonCaption") 'Nor this...
'rst.MoveNext
'Loop
I am lost as to what to try next. Any help would be appreciated.
Can anyone help me?
address about 120 labels on a form On_Activate and change the caption of each
based on a user's preference stored in a table. The table is:
UserName (Each user has specified templated text that goes into the text
box)
Button Name (refering to the label name on the form)
Button Caption (The new caption to replace the existing caption)
Text (Text to be inserted into the label's associated text box when
clicked by user)
I have attempted to do this in this way (Debug.print used to test the code
to see what works and what doesn't):
Do Until rst.EOF
Debug.Print "rstBN="; rst.Fields("ButtonName") 'This works fine...
BN = rst.Fields("ButtonName")
Debug.Print "BN="; BN 'This works fine also...
Debug.Print Me.BN 'This doesn't work...
Debug.Print Me.BN.Caption 'Nor does this...
BC = rst.Fields("ButtonCaption") 'Nor this...
Debug.Print "rstBC="; rst.Fields("ButtonCaption") 'Nor this...
'rst.MoveNext
'Loop
I am lost as to what to try next. Any help would be appreciated.
Can anyone help me?