query + combo box

mamfa

New Member
Joined
Jun 23, 2006
Messages
25
i have a query that i need to look up what is selected in a combo box and then show the relevant records

HELP AGAIN PLEASE :)
Samantha
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi Samantha

In your query design screen, under the field on which you want to filter, enter the following criteria :

=[Forms]![MyForm].[MyComboBox]

Make sure you use your actual form name where I have used MyForm and use the actual name of the combo box where I have used MyComboBox.

HTH, Andrew
 

mamfa

New Member
Joined
Jun 23, 2006
Messages
25
thanks i had just put the name of the combo box in so i was close :)
 

mamfa

New Member
Joined
Jun 23, 2006
Messages
25
if i enter what you have said i still get a parameter box come up asking me to enter the word im serach for?
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi

Can you copy and paste the full SQL for the query into your answer? You can get to the SQL by clicking on view > SQL view. Can you also provide the name for of the form and the combo box on that form?

Before you do that, have you checked you have the correct syntax, form name and field names? Most often, the paramater boxes appear in this situation because of a typo or something similar. Lastly, you could try creating a parameter by going into the query design screen and clicking on Query > Parameter and adding [Forms]![MyForm].[MyComboBox] with the approprate data type.

Also, are you just trying to open a query, or something else (like a report) based on that query?

HTH, Andrew
 

mamfa

New Member
Joined
Jun 23, 2006
Messages
25
oops have double checked and it was a typo it is now doing as i wish thank you for your help im sure ill be asking again soon
 

Forum statistics

Threads
1,136,267
Messages
5,674,729
Members
419,523
Latest member
Urnovio

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top