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

Wildcard for query

Status
Not open for further replies.

prodtest

Technical User
Aug 29, 2003
55
0
0
GB
Is there a wild card mask that can be used in a query?
i.e I have a table filled with records starting with various prefixs some have PO some have 34 others have other prefixs, is it possible to enter a wildcard in a query so you find all the records beginning PO or 34 etc ?
For instance I have a form which has a text box which gives the query its information, the query basically says
= [text1] but with this the user has to put the complete number in, is it possible to use say PO***** in the text box to find all records beginning PO ?
 
Look up "Like" in Access help

Hope this helps
Hymn
 
Select * from table_name where field LIKE "PO%"

---------------------------------------
2b||!2b that == the_question
 
Hi,
Use this in the criteria of the query.
This will bring all the records starting with letter(s) you enter.
Like & [Forms]![YourFormName]![text1] & "*"
or use this
Like "*" & [Forms]![YourFormName]![text1] & "*"
to bring all the records that includes the letter(s) that you enter.

Note: Change "YourFormName" to form's name "text1" to textbox name.
regards

Zameer Abdulla
 
You asked, "is it possible to use say PO***** in the text box to find all records beginning PO?"

If you use
Like [Forms]![YourFormName]![text1] & "*"
for the criteria in the query...

...and you enter PO in the text box, this will give you the results you want.

Zameer's example would give you anything containing the letters "PO".

Karl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top