S
Sarah
I have code like this:
If cboTask.Value = "A2" then
Me!txt_A2_1.Enabled = True: Me!txt_A2_2.Locked = True: ....
... more similar property-setting code here...
End If
This code occurs over 10 times in one of the Subs behind my form. All is
IDENTICAL each time, except for the 'A2' part. This part is always 2
characters long (A2, C6, B1, ...etc.)
Is there a good way to have the lines between the If and the End appear just
once. I'm thinking of using something like Me!txt_XX_1.Enabled... etc, then
subbing in A2, C6, B1... for the Xx. I can't seem to get the syntax right.
Thanks for any assistance
Sarah
If cboTask.Value = "A2" then
Me!txt_A2_1.Enabled = True: Me!txt_A2_2.Locked = True: ....
... more similar property-setting code here...
End If
This code occurs over 10 times in one of the Subs behind my form. All is
IDENTICAL each time, except for the 'A2' part. This part is always 2
characters long (A2, C6, B1, ...etc.)
Is there a good way to have the lines between the If and the End appear just
once. I'm thinking of using something like Me!txt_XX_1.Enabled... etc, then
subbing in A2, C6, B1... for the Xx. I can't seem to get the syntax right.
Thanks for any assistance
Sarah