wildcard criteria with space from form

  • Thread starter 2Blessed4Stress
  • Start date
2

2Blessed4Stress

I'm using the value of a form to search but I'm having problems getting the
end result. If I was using a query my criteria would be: like "*2835? *".
This would look in the DESCRIPTION field and give me everything with just one
character after the number followed by a space and then everything else.
When I tried to use the same format using my form it doesn't work:

Like "*"*[Forms]![frm_PtNoSrch]![Part_number]&"?"&"*"

I also tried:

Like "*"*[Forms]![frm_PtNoSrch]![Part_number]&"_"&"*"

What am I doing wrong?
 
D

Douglas J. Steele

You've got an asterisk between the first "*" and
[Forms]![frm_PtNoSrch]![Part_number] instead of an ampersand:

Like "*" & [Forms]![frm_PtNoSrch]![Part_number] & "?*"
 
2

2Blessed4Stress

That was a typo in this post. I have one in my criteria. I figured it out
and I also needed a space between the last "? *".

Thank you for your response.

Douglas J. Steele said:
You've got an asterisk between the first "*" and
[Forms]![frm_PtNoSrch]![Part_number] instead of an ampersand:

Like "*" & [Forms]![frm_PtNoSrch]![Part_number] & "?*"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


2Blessed4Stress said:
I'm using the value of a form to search but I'm having problems getting
the
end result. If I was using a query my criteria would be: like "*2835? *".
This would look in the DESCRIPTION field and give me everything with just
one
character after the number followed by a space and then everything else.
When I tried to use the same format using my form it doesn't work:

Like "*"*[Forms]![frm_PtNoSrch]![Part_number]&"?"&"*"

I also tried:

Like "*"*[Forms]![frm_PtNoSrch]![Part_number]&"_"&"*"

What am I doing wrong?
 
Top