Drop-Down List Selector for a Query. NEWBIE QUESTION

HappyBunny

Registered User.
Local time
Today, 12:53
Joined
Jun 6, 2008
Messages
22
HI,
I have a form with a few combo boxes on it and want to add a 'Run Query' Button to it to open a query for each combo box.
BUT
What do I put for a criteria in each query field????
i tried

[Forms]![frmCOMBOBOX].[cboRelay_ID] , but it didin't work..

COMBOBOX is the name of my form with the combo box fields
Relay_ID is the field name that i'm trying to run a query on.
Please help...
 
Try

[Forms]![frmNAME]![COMBO#]

Where frmNAME is the name of the form
COMBO# is the number of the combo in the form.
 
Thanks Statsman. :D

What kind of a format is COMBO# in? Do I just put down a number..like 2, for example??
 
If it's Combo6 you would enter:

[Forms]![frmName]![Combo6]

Right click on the combo box with the form in design view and select Properties. The Combo number will be displayed at the top.
 
If it's Combo6 you would enter:

[Forms]![frmName]![Combo6]

Right click on the combo box with the form in design view and select Properties. The Combo number will be displayed at the top.

i would urge ALWAYS to rename your control to a relevant easy to remember name. never leave as the default Combo1 Combo2.... etc this will help you later in coding, finding, referencing etc etc etc etc... knowing what's on your form. not to mention that if you place a combo on your form, delete it, and then put a new combo on your form, Access calls this new combo "Combo2", though it may be the only combo on the form. the more combo you have, the more confusing / hard to remember they will be UNLESS you rename them (like, cboName, cboCompany, cboNameID... whatever your combo is there for - i even use names like "cboSelectPerson")

"Combo#" that statsman refers to would be the exact name you have given your control, if you have not given your control a name, it would have the default access-imposed name associated with it, which is usually the control type followed by a number.
 
I handle that at the post-grad level. This is Access 101. :D

Your point is well made however.
 
yes, i suppose one thing at a time, but also this is a basic thing that should be done form the outset, which, once done, will not have to become a massive re-naming project involving both field controls and VBA and reports etc... etc... most of the newbies on this forum (nyself included) are not doing 'practice'-databases, they are putting together the database that they will be using in the future for all time (well, i may be exagerating that last bit! LOL), and it's one of the very first things i was told to do in an Basic Access course (MANY years ago now). it has helped tremendously.
 

Users who are viewing this thread

Back
Top Bottom