Help with Automating Parameters

paynete

New Member
Joined
Oct 26, 2004
Messages
5
Hello, I am hoping someone can help me. I'm fairly new to access.
I have a simple query that I am running via a form. My problem is that I need to change the value of one field to limit my query return. I always need to change it to the same 4 values (numeric). I don't want to have to create 4 seperate queries, so is there away to tell Access to run the query with one value...then run it with the second value and so on? :rolleyes:

Any help would be appreciated :pray:
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hello and welcome.

There are a couple of ways of doing this.

If you go into the query design and in the criteria section of the query, under the variable name which you wish to filter, you can do one of 2 things, either :

a) in the criteria section enter something like =[Enter limit value] and every time you run the query (via the form) then a message box will pop up that says "Enter limit value" where you enter the value you wish to filter on and then click Ok. After the first value, requerying the form may force the query to run again to allow you to enter the next value (not tested).

b) Alternatively, if the 4 values are not going to change and you want to see all 4 instances on the form at the same time, then under the criteria section of the variable enter "=value1 or value2 or value3 or value4" (except don't use the quotes and make sure you use the actual values, not the tags I used of "value1" etc). Whenever you run the query all 4 instances will show.

I realise this hasn't answered your question 100% but I can't think of another way around this. Someone else may be able to contribute something else.

HTH, Andrew. :)
 
Upvote 0

Forum statistics

Threads
1,221,825
Messages
6,162,166
Members
451,750
Latest member
dofrancis

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
Back
Top