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!

show all records in query if no value entered

Status
Not open for further replies.

BradCollins

Technical User
Sep 2, 2003
116
AU
Hi All,

I have a query that restricts my data to the selected truck number, and the last 3 digits of the trip number.
This works fine, and shows all the correct results, what I want to do now is in the same query show all trips for the selected truck of nothing is entered in the trip id field.

what I have is:

iif([RestrictSearch] is null, like "*", right([TripID],3))

it will still show the records based on the last 3 digits, but shows no records if the RestrictSearch field is blank.

Any help would be most appreciated. Thanks
 
Perhaps this ?
Code:
=Right([TripID],3) Or Trim([RestrictSearch] & '')=''


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

Thank you for such a quick response, I have tried this, and now it asks for an additional parameter to be entered, and also it now shows all records all the time.

Thanks again for your help
 
Thanks again, looks like it was my typing, it now works perfectly

Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top