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!

Using LIKE with wildcard Error 1

Status
Not open for further replies.

wayneryeven

Technical User
Joined
May 21, 2004
Messages
101
Location
GB
Hi Guys
I have a form in which a user selects an Item No. When they click a button a report opens- what i want to do is limit the query to only meet the item they selected in the list.

In my query under item No i have:

Like "*" & [Forms]![frmMyForm]![SelectItem] & "*"

I have items numbered from 1-100

If i select Item no 1 from the dropdown, i get returned a list for 1,10,11,12,13....basically where ever it finds a 1 in my list of items.

What am i doing wrong and how do i correct it to only show the one item no i have picked?

Many Thanks everyone
 
Thanks, BUT (as there always is!) I want it that if the user fails to seelct an item then the report will show ALL items?

Removing the wild cards limits my report to their selection- if they dont select, then nothing shows on the report?
 
Replace this:
Like "*" & [Forms]![frmMyForm]![SelectItem] & "*"

with this:
=[Forms]![frmMyForm]![SelectItem] OR [Forms]![frmMyForm]![SelectItem] Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
doh! why of course! thanks PHV- legend as ever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top