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

How would I write a parameter query that allows more than one entry?

Status
Not open for further replies.

kramerpup

Technical User
Mar 2, 2001
25
US
I would like to allow users to enter more than one or a range of project numbers to print a set of reports based on the project numbers input. Right now the parameter query asks for one number and returns that record, or all records if left blank-basically using a simple "If(IsNull.." statement as criteria.

I have in mind something like a Word print dialog box that allows you to enter 1 page (e.g. 1), several pages (1,2,3), or a range (1-3).

Is this possible?
 
Possible? Yes. Easy? NO!

I would not do this on a casual basis. It would (IMHO) require some fairly elaborate processing. If there were LIMITS on the number and arrangement of the 'sets' of parameters, it could be done by setting up defaults for the parameters. TO do this in a "free form" arrangement, you would need to 'define' the convention(s) used (e.g. "," following ends PARAMETER set, "-" indicates "Between preceding and following identifiers, "*" meanes "ALL", empty Means [All | None] ... ) and a host of hordes of others. Then you would need to parse the input to sort out the required record characteristics and "build" the entire SQL statement - including the WHERE clause - based on the parsed characteristics.

The generic SQL should be easy. VBers do it all the time. The Where clause could be a molehill or a mouontain, depending on HOW flexible you really want/need it to be.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top