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

Input query options to receive 1, 2 or all records. 1

Status
Not open for further replies.

everyda7

Technical User
Mar 13, 2006
3
US
I have a SUBCATEGORY Field. Within that field I would like to select, Images, Print Forms or both. These are the only options. Using the following I can receive either or:[Enter Images, Print Forms]. What can I do to receive the 3rd option which is all of them (everything).
 

If in a parameter query ...
The following example uses a table for branches, asking which branch name to show. If no name entered in the popup form, the query returns all!

PARAMETERS [WhichOne] Text ( 255 );
SELECT Branches.*
FROM Branches
WHERE (((Branches.Name)=[WhichOne])) OR ((([WhichOne]) Is Null));

Adjust this to your needs
 
I received the following error message: "Invalid (dot) or ! or invalid parenthesis. I tried adjusting but no luck.
 
SELECT ...
FROM ...
WHERE SUBCATEGORY=[WhichOne] OR [WhichOne] Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The code below worked:

Like "*" & [Please Enter Information] & "*"

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top