Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: lookup string in query


Message #1 by "Howard Stone" <ququmber@h...> on Tue, 22 Oct 2002 19:34:40
I want to search for the string "Monday" in a query.  I enter 
Like "*Monday*" and I got the result.

Now, I want to put a text box on a form for the user to enter the search 
word and a cmdButtton to run the query.  I tried Like "*&Forms!frmName!
txtSearch&*" and Like "*Forms!frmName!txtSearch*" in the criteria section 
of the query but I am not getting the correct result.  How do I write this 
to get the correct result ?

Thanks
Message #2 by "Derrick Flores" <Derrick_Flores@s...> on Tue, 22 Oct 2002 13:37:01 -0500
Try Using Like "*" & [Forms]![Form2]![txtSearch] & "*"  in your criteria

Good Luck
Derrick Flores

>>> ququmber@h... 10/22/02 07:34PM >>>
I want to search for the string "Monday" in a query.  I enter
Like "*Monday*" and I got the result.

Now, I want to put a text box on a form for the user to enter the 
search
word and a cmdButtton to run the query.  I tried Like "*&Forms!frmName!
txtSearch&*" and Like "*Forms!frmName!txtSearch*" in the criteria 
section
of the query but I am not getting the correct result.  How do I write 
this
to get the correct result ?

Thanks

Message #3 by "John Ruff" <papparuff@c...> on Tue, 22 Oct 2002 11:37:34 -0700
Like '*'" & Forms!frmName!txtSearch & "'*'"

John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities

www.noclassroom.com
Live software training
Right over the Internet

Home:  xxx.xxx.xxxx
Cell:  xxx.xxx.xxxx
9306 Farwest Dr SW
Lakewood, WA 98498




-----Original Message-----
From: Howard Stone [mailto:ququmber@h...] 
Sent: Tuesday, October 22, 2002 7:35 PM
To: Access
Subject: [access] lookup string in query


I want to search for the string "Monday" in a query.  I enter 
Like "*Monday*" and I got the result.

Now, I want to put a text box on a form for the user to enter the search

word and a cmdButtton to run the query.  I tried Like "*&Forms!frmName!
txtSearch&*" and Like "*Forms!frmName!txtSearch*" in the criteria
section 
of the query but I am not getting the correct result.  How do I write
this 
to get the correct result ?

Thanks



Message #4 by "Wayne Ryan" <wayne.ryan@t...> on Tue, 22 Oct 2002 20:18:09
Shouldn't it be:

Like "'*" & Forms!frmName!txtSearch & "*'"

Wayne

Message #5 by "Carnley, Dave" <dcarnley@a...> on Tue, 22 Oct 2002 14:51:15 -0500
Although John is usually right, I think he might have fat-fingered that one.
However one thing I know about Access is that you just never know,
especially in the QBE.  John?

What Wayne wrote looks right to me... but I've had problems trying to do
this exact thing and now I have designed my apps so I don't have to use this
technique: I build the entire SQL string in code.




-----Original Message-----
From: Wayne Ryan [mailto:wayne.ryan@t...]
Sent: Tuesday, October 22, 2002 3:18 PM
To: Access
Subject: [access] RE: lookup string in query



Shouldn't it be:

Like "'*" & Forms!frmName!txtSearch & "*'"

Wayne


  Return to Index