Trying to store a control reference as a variable

wrekless

Registered User.
Local time
Today, 11:59
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:

forms!frmYourForm.Controls("yourcontrolname")
 
try this so

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

Fieldname =Forms![EQSRCL Update].controls(Other_Fieldname).name
 

Users who are viewing this thread

Back
Top Bottom