Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a variable name to update a control

Status
Not open for further replies.

osera

Technical User
May 15, 2006
35
US
Good morning!

I have a form with several sets of text box/combo box pairings. My hope is to have control buttons that will call a function that will perform operations on a specific text/combo pair, depending on which button is clicked.

Essentially, I click a button, pass the combo box and text box names to global variables, then call the function which uses those varibles to know which pair of controls to use.

The problem I'm running into is how to add the variable into the VBA. Is there a way I can write

[Forms]![FormName].[ControlName]=?????

as

[Forms]![FormName].<GlobalVariable>=?????

Where the control is identified by the global variable?
 
[Forms]![FormName].Controls(<GlobalVariable>) = ?????

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Brilliant! I love this site.

Thank you very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top