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

Dynamic Parameter Query

Status
Not open for further replies.

ahmun

IS-IT--Management
Jan 7, 2002
432
US
I'm wondering how to make a parameter query take either a string as a parameter or the ability to dynamically add parameters to the query. (access 2000/2003)

Here's some background info:
[ul][li]I have a table of different job numbers.[/li]
[li]A form lists these job numbers in a list box, allowing the user to pick multiple items[/li]
[li]once the criteria is chosen, a summary report of each job's statistics is shown.[/li][/ul]

How would I tell the parameter query filter by the user's selection? I've tried generating a string based on the user's selection that is a where clause like so:
Code:
(intJobNumber = 1234) or (intJobNumber = 5555) or ...
I store this string into an unbound control, and try to make the query read this as its parameter, but Access somehow likes to set the SQL to say
Code:
WHERE intJobNumber = "whatever the paramter value is"
and I'm not sure if it inserts the quotes or not... but that doesn't seem to work...

any ideas?

Thanks...

and by the way... has anyone experienced trouble with the search function? I tried searching for posts on "parameter queries" only in the Access Jet SQL board, but it seems to return results on ALL forum topic areas.


Earnie Eng
 
You can't use a value like this. Check faq703-3936 for a function on how to use a multi-select list box to filter a report.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top