Microsoft
Software
Hardware
Network
Question : Combo box selection used for an Access query
I have an Access form with a combo box on it. The combo box uses a two-field table as its data source. The two-field table has the proper names of United States states listed in column 1. Column 2 has that states' abbreviations. The table looks as follows:
Column 1 Column 2
Alabama AL
Alaska AK
Arizona AZ
etc.
The selection made with the combo box displays the selected state's proper name the user. However, my query needs to use the abbreviation of the state. How do I modify the following code, which is an excerpt from my presently non-working query, so that the state abbreviation will be used to run the query?
MyDataTable.State=[Forms]!
[MyForm1]!
[cmbSelect
edState]
It's the part to the right of the equal sign that I need help with. cmbSelectedState is the name of my combo box. When a selection is made, the state name is displayed on the screen. However, it is the associated state abbreviation that I need to be fed into the query.
Answer : Combo box selection used for an Access query
MyDataTable.State=[Forms]!
[MyForm1]!
[cmbSelect
edState].C
olumn(1)
Column numbering starts at 0, so 1 would be the 2nd column.
Random Solutions
Outlook '07 Archive Sent folder doesn't show the TO: field.
combine text data in textboxes on form
Access Runtime Error
Outlook VB Code Quit Working
Access VBA Code with Excel Object Save As just started generating the Automation Error - The server threw an exception.
Outlook Anywhere Config on sbs 2008 (RPC over HTTP)
Computer Browsing (My Network Places)
How do I move a worksheet from one spreadsheet to another, while keeping all formulas exactly the same (so it doesn't move the file name with it)?
IE7 browser issue with JS fancybox
Visual Studio 2008; Website project; bin folder now showing?