You can reference objects like this (just tested in my form)

    Debug.Print Me("txtCourseCode")

And the string value in quotes could be a concatenation:

"txtInput" & SuffixValue

Tobi

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of stcuser
Sent: Wednesday, September 21, 2005 9:46 AM
To: [email protected]
Subject: [AccessDevelopers] Variable object names


Say I have a dozen text box controls on a form, each named similary:
txtInput01, txtInput02,...,txtInput12. I want to code a common routine 
that affects only one of these controls. Is there a way I can construct 
the control name at runtime based on the variable portion of the name?
In other words, I won't know until runtime which of the twelve text 
boxes I need to process, but I will have the correct number (01 - 12) 
and would concatenate the number to a constant value of "txtInput" to 
get the complete control name.






Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~-> 


Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to