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!

Issue with "*" parameter in criteria

Status
Not open for further replies.

maxxev

Technical User
Jul 17, 2008
139
NL
Hi, I have an unbound list box using data that is queried to diplay results based on the values users put into "search" text boxes and one combo box.

My issue is when there is a non-exisitant value the query misses the record all together, even when there is nothing selected in the combo or written in the text box, which i'm guessing is because of using the "*".

Can someone point me in the right rirection please baring in mind my programing skills are minimal.

Here is the code used on text boxes
Code:
Like "*" & [alpha1].[text] & "*"

And the combo box
Code:
[Forms]![Company_Selection_Form]![Combo0] Or Like IIf(IsNull([Forms]![Company_Selection_Form].[Combo0]),"*",([Forms]![Company_Selection_Form].[Combo0]))

Thank you
 
This issue might be that a Null value in a field will not match
Code:
  Like "*"
If the field name is [MiddleInit] you can use something like:
Code:
  WHERE [MiddleInit] & "" Like "*"
Adding a zero-length-string to a null converts the null to a string.


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top