Can control references be stored in variables?

wrekless

Registered User.
Local time
Today, 19:12
Joined
Jun 1, 2000
Messages
31
Does anyone know if a control name(s), can be stored in a variable? Is concatenation available? I can't get it to work.

Example:
Forms![EQSRCL Update]![OptionMANUF]

Dim FieldName As String
Fieldname = "OptionMANUF"

Could this be manipulated like:
Forms![EQSRCL Update]!Fieldname ????

The reason I have to use this feature is because I have to write a code for 74 fields and instead of repeating it, I was hoping to use a loop.
 
Try this instead. By using the Controls collection you can specify a name or index number. (Most people use the name, who can remember all those numbers)

Example:
Forms![EQSRCL Update]![OptionMANUF]

Dim FieldName As String
Fieldname = "OptionMANUF"
Forms![EQSRCL Update].Controls(Fieldname)
 

Users who are viewing this thread

Back
Top Bottom