multiple parameters

O

Owen

Hello,

I have a query that I want to return data based on a
varying number of parameters. For instance, truck #1
may have 3 bundles and truck #2 may have 5 bundles. I
need to determine the weight of each truck based on the
weight of the bundles(which varies).

I have entered:
Like "*" & [Please Enter the Bundle #] "*" Or Like _
"*" & [Please enter the next Bundle #] & "*"

in the Criteria box, and it works fine so long as I only
have two bundles. If I have only one bundle, the second
box is left blank and the query returns all values.

How can I continue to get dialogue boxes until I have no
more bundle numbers left to enter, and let the query know
I am done?

TIA

Owen ?
 
M

Michel Walsh

Hi,


Have a table:



TrucksBundles ' table name
TruckNumber BundleNumber ' fields name
1 16
1 17
2 18
3 19
3 23
3 24
3 26



and use something like:


SELECT ...
FROM myTable INNER JOIN TrucksBundles
ON myTable.bundleNumber=TrucksBundles.bundleNumber

WHERE TrucksBundles.TruckNumber = [Enter the truck number: ]



You have to fill the table TrucksBundles first, and then, just specify
the truck number (just one parameter, indirectly referring to a variable
number of bundles)... rather than specifying "n" bundles as parameters.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top