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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Values from Combo Box into a button

Status
Not open for further replies.

Hacktastic

Technical User
Feb 27, 2007
54
US
Hello all,

This is my first post so be gentle.

I am creating a form in access, and I have a drop down combo box with a list of choices I made from a Value list.

Next to it I have a button.

I want the button to read the selected value from the combo box and run the appropriate code.

The only thing i am missing is how to pass the value from the combo box to vba.

Code:
Dim strGlobal As String
Me.[Comboboxname]= strGlobal

Then
Iff strGlobal = "x" then call x..etc

Any ideas?
 
You want strGlobal to have the value in the combobox, right? In that case it should be:

strGlobal = Me.[Comboboxname]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top