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

Wildcard Parameter Query problem

Status
Not open for further replies.

perrydaniel

Technical User
Apr 27, 2004
56
IE
Hi is it possible to write a query, which looks at a Wildcard entry or what is entered in the Parameter option.

Basically I am trying to write a query where the User has the option to search for a Customer on Either First or Surname, but prefabably in the same query. So if they know the first name, but not the Surname they can Search on just 'Mark' and put an * in for the Surname. Or if they know the Surname but not the First Name they can do the opposite, i.e Name = * Surname = Jones. and finally... If they know both Names they can enter 'Mark for Name and Jones for surname? Is this poss???

The options being
1. * [Please Enter Name] *
2. * [Please Enter Surname] *

Many thanks for your help

[sadeyes]
 
1. Like '*' & Nz([Please Enter Name], '*') & '*'
2. Like '*' & Nz([Please Enter Surname], '*') & '*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks a million, works a treat! What does the Nz do?

Thanks
[thumbsup2}
 
What does the Nz do?
While in VBE (Alt+F11) open a debug window (Ctrl+G) type nz and press the F1 key.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top