access form fields by string?

M

MattE

I have a bunch of form fields named TxtSpec01 through TxtSpec39. Can I
access these fields (both values and properties such as Enabled) by
string? In other words I want to make a loop from 1 to 39 and create
the field name in a string and access the field via that string.

I know I could if it was a RecordSet but I haven't been able to get it
done as a form.

Thanks for any ideas!
Matt
 
W

Wei Lu [MSFT]

Hi Matt,

Thank you for your posting!

My understanding of this issue is: You want to refer the form fields in the
VBA code. If I misunderstood your concern, please feel free to let me know.

I agree with Jethro's suggestion. You could use Me(<field name>) to refer
the field.

Please let me know the result, if you have any questions, please feel free
to let me know.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Top