Using wildcards

bodvoc

Red Sea Pedestrian
Local time
Today, 20:19
Joined
May 4, 2003
Messages
54
Hi Guys

Tried searching on this but drawn-a-blank...........

I have fields in my db that hold a surname and a ref type... i.e....

Bloggs (R)

I need to use a wildcard in the query that will bring up Blo *, in short include spaces, and any ending of the primary search.... Can it be done???

Thanks in advance...

Bodvoc....;)
 
Put this into your criteria line:
Like "Blo*"
 
Last edited:
You could also try putting the following in the criteria:

Like "*" & [enteparameterhere] & "*"

This will bring up anything with the criteria you specify.
 
:) You are a god, that worked great... Thanks for your time.. Bodvoc :)
 
Personally, I'd put a textbox on a form and a command button.

The user would type their search into the textbox and then click the command button.

It offers more functionality as you can check the query when you click the button and inform the user that there is no records, etc, and you can verified that what the user wans to search with is valid for that field. No pint in searching for numbers in a name field.

Like "*" & [Forms]![frmYourForm]![txtYourTextbox] & "*"
 
Cheers Mile-O-Phile

EXCELLENT!! Will try that....

Q. If I wanted the form that is based on a query to open with a new record instead of doing a search, any ideas how can I do that??

Cheers again :)

bodvoc
 
For a new record:

DoCmd.OpenForm "frmNameHere", acNormal, , , acFormAdd, acWindowNormal
 
Great, thanks for that.... all sorted out now... :)
 
Hi Mile-O-Phile

Ummm, don't know to word this given the take a mile quote.. ;)

Did what you suggested, now they want the same thig to work in the form it opens... can this be done??? I have tried, but.. the Form and text boxes open OK, but when you click the command button, nothing happens... :confused:

What am I doing wrong???

Thanks again........

Bodvoc.......
 
Can you detail this in much greater detail or post a '97 example of what you have thus far?
 
DONE IT

After leaving it for a bit, got it sussed! Just a syntax thing, to many "," and not enought thought... Thanks all for helping...

Bodvoc ;)
 

Users who are viewing this thread

Back
Top Bottom