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

Prompting for Selection Criteria

Status
Not open for further replies.

opa

Technical User
Jul 10, 2001
5
US
I am using a query that uses a parameter . When I run the query Access displays the "Enter Parameter Value" dialog box. To help the user, I would like to have a combo box list the choices for the paramter value. Can this be done? I would appreciate any commnets. Thax
 
Is the user going to use the query directly, or are they going to be openning a report driven by the query?
 
Hi,

As far as I am aware (and I may be wrong) you cannot have a combobox displayed when you run the query without writing some code. I would suggest that you just create an unbound form that has a combobox on it. Then based on what the user selects from the combobox you would then run the appropriate query.

I.E.

Here is the code behind the combobox (the "After Update" event):

Select Case Me!ComboboxName
Case Jerry
DoCmd.RunQuery "QueryName"
Case Thomas
DoCmd.RunQuery "Thomas"
Case Ellen
DoCmd.RunQuery "Elle"
Case All
DoCmd.RunQuery "All"
Case Else
MsgBox "Message for user"
End Select

HTH,

jbehrne If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
First and foremost thanks for your inputs. The user will open a report driven by the query.
Thx
Cheryl
 
Hi,

Could you post the items that you want the user to select from and your report's query and report name?

Thanks,

jbehrne If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Hi

The item is part number
Report Query name is Job Card Query by Part Number
Report is Job Card

Thanks Jb

Cheryl
 
Hi Cheryl,

I have created an unbound form that allows the user to limit a report based on the form's selection. However, it is a wee bit to complicated to document here. If you send me an e-mail to: jbehrne@hotmail.com I will send you the database so that you can look at it and make changes to your db (basically you will have a guide to set up your db...)

jbehrne If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top