Form selecting Criteria for query

honey2wood

Registered User.
Local time
Today, 07:11
Joined
Feb 16, 2010
Messages
43
Good evening,

I have seen a number of questions asking the same question but not one that fits my needs.
I have a query that I need to select a number of criteria for.
I have lots of parts that make up sets.
I want to have a form with a list box that lists the set names. When one is selected the query will show all the parts in that set. Some parts are unique to a set some are duplicated.
I have seen somewhere a VB routine that does this but I can't for the life of me find it.
Does anyone have any ideas please.

Thanks in advance.

Graham
 
There are several methods to accomplish this. Here is the simplest.

Create a blank form. Name the form SearchFRM.

On SearchFRM, place a combo or list box. The contents of the combo box should match the contents of the field it will be searching for. Make a note of the combo box name by checking the box's properties. In this case we will give it the name of Combo2.

In the query that controls your search, in the criteria for the field you will be searching on enter the following:

[Forms]![SearchFRM]![Combo2]

Run the query. You will be prompted for [Forms]![SearchFRM]![Combo2] Mannually enter an apropriate search name or number. The query should return the record(s) you require.

Go back to SearchFRM. Place two command buttons on the form. Set the first to open the query or the display form for the query (if you have one). Set the second to close the SearchFrm
 
Thanks Statesman for that. It does work well.

Cheers
Graham:)
 

Users who are viewing this thread

Back
Top Bottom