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

Pull Records From Table With ComboBox List

Status
Not open for further replies.

matcom

Programmer
Jun 19, 2003
14
US
Hi all.

I have created a paramater query that uses a command button to pull sales records from a database based on the input of the salesperson's name. That works great.

The issue is that management wants to select a salesperson from a drop-down list. I have a combo box created on a form that successfully pulled all the salespeople into it from the table using the wizard. So, now I have a list to select from.

I don't know how to select a name from the list and run the query using the onChange event. If I keep the criteria in the query the same, "Like [Enter name:]" it still prompts me to enter the name.

I guess what I need to know is what needs to be in the criteria in the query to recognize the right salesperson in the combo list and pull their records? Is it something that needs to be added to the macro before running the query?

Thanks all in advance.
 
You can replace the parameter prompt with:

Forms!frmYourUnnamedForm!cboYourUnnamedComboBox

Normally you would expose records to your users with forms or reports. If you do this, you can use the Where Condition of DoCmd.OpenForm or DoCmd.OpenReport.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top