I have about 500 controls I need to loop through, each named according to a specific number/letter combination for easy reference.
I want to decide WHICH control to update based on a string variable, but I have looked around and cannot seem to find any way to use/convert a string variable to an actual control name, so that I may use it.
Something like this:
Public Function MapTableFields(PASSrs As DAO.Recordset)
Dim fldNUM As Integer
Dim sfldNUM As String
Dim fldLET As String
Dim strtblField As String
Dim ctltblField As Control
Do
fldNUM = fldNUM + 1
sfldNUM = Str(fldNUM)
fldLET = "a"
strtblField = "cbOField" & sfldNUM & fldLET
ctltblField = strtblField (????)
ctltblField.Value = PASSrs(0).Value
Loop Until fldNUM = 10
THANKS for any insight!
I want to decide WHICH control to update based on a string variable, but I have looked around and cannot seem to find any way to use/convert a string variable to an actual control name, so that I may use it.
Something like this:
Public Function MapTableFields(PASSrs As DAO.Recordset)
Dim fldNUM As Integer
Dim sfldNUM As String
Dim fldLET As String
Dim strtblField As String
Dim ctltblField As Control
Do
fldNUM = fldNUM + 1
sfldNUM = Str(fldNUM)
fldLET = "a"
strtblField = "cbOField" & sfldNUM & fldLET
ctltblField = strtblField (????)
ctltblField.Value = PASSrs(0).Value
Loop Until fldNUM = 10
THANKS for any insight!