Parameter Query using Wildcard doesn't give me the results I want

G

Guest

I've read just about every message regarding using Wildcards with a parameter
query but am still having problems. In my parameter query I input "Station
#2" but I get all the stations shown below (Station #7 is coming up because
"L42A" is part of Station #7's string).

Workstation
Station #2 - Hot Plate Weld 04 Nissan ZW
Station #7 - Attach Park Reflector / Bulb Assembly 07 L42A
Station #2 - Hot Plate Weld 04 Nissan

these are my results but I don't want "Station #7".

The criteria I'm using is

"Like "*" & [Station #] & "*".

Is there a way to only get "Station #2" and any text after it, and not
"Station #7". Hope I explained this clearly. Thank you.
 
G

Guest

If you use Like "*" & [Station #] & "*" you will get all
stations.

For station #2 use Like "*" & [Station #2] & "*".
 
G

Guest

Thanks for your response Karl, this is a parameter query allowing the user to
put in the station number. There are about 30 different stations so I won't
know what station they want until they run the query. Can code be written
allowing the user to input the station number? Thanks.

KARL DEWEY said:
If you use Like "*" & [Station #] & "*" you will get all
stations.

For station #2 use Like "*" & [Station #2] & "*".


--
KARL DEWEY
Build a little - Test a little


Michelle said:
I've read just about every message regarding using Wildcards with a parameter
query but am still having problems. In my parameter query I input "Station
#2" but I get all the stations shown below (Station #7 is coming up because
"L42A" is part of Station #7's string).

Workstation
Station #2 - Hot Plate Weld 04 Nissan ZW
Station #7 - Attach Park Reflector / Bulb Assembly 07 L42A
Station #2 - Hot Plate Weld 04 Nissan

these are my results but I don't want "Station #7".

The criteria I'm using is

"Like "*" & [Station #] & "*".

Is there a way to only get "Station #2" and any text after it, and not
"Station #7". Hope I explained this clearly. Thank you.
 
J

John Spencer

You might try the following. Where all the user enters is the number of the
station.

Like "Station [#] " & [Enter Station No] & "*"

That will find all records where the field starts with "Station", a space,
the character "#" and the number character(s) entered by the user.

Since # is a wildcard meaning ANY number character you need to surround it
with [] to tell the computer to treat it as the character "#" instead of any
number character (0 to 9).
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Michelle said:
Thanks for your response Karl, this is a parameter query allowing the user
to
put in the station number. There are about 30 different stations so I
won't
know what station they want until they run the query. Can code be written
allowing the user to input the station number? Thanks.

KARL DEWEY said:
If you use Like "*" & [Station #] & "*" you will get all
stations.

For station #2 use Like "*" & [Station #2] & "*".


--
KARL DEWEY
Build a little - Test a little


Michelle said:
I've read just about every message regarding using Wildcards with a
parameter
query but am still having problems. In my parameter query I input
"Station
#2" but I get all the stations shown below (Station #7 is coming up
because
"L42A" is part of Station #7's string).

Workstation
Station #2 - Hot Plate Weld 04 Nissan ZW
Station #7 - Attach Park Reflector / Bulb Assembly 07 L42A
Station #2 - Hot Plate Weld 04 Nissan

these are my results but I don't want "Station #7".

The criteria I'm using is

"Like "*" & [Station #] & "*".

Is there a way to only get "Station #2" and any text after it, and not
"Station #7". Hope I explained this clearly. Thank you.
 
G

Guest

That did it!!! Thank you so much!

John Spencer said:
You might try the following. Where all the user enters is the number of the
station.

Like "Station [#] " & [Enter Station No] & "*"

That will find all records where the field starts with "Station", a space,
the character "#" and the number character(s) entered by the user.

Since # is a wildcard meaning ANY number character you need to surround it
with [] to tell the computer to treat it as the character "#" instead of any
number character (0 to 9).
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Michelle said:
Thanks for your response Karl, this is a parameter query allowing the user
to
put in the station number. There are about 30 different stations so I
won't
know what station they want until they run the query. Can code be written
allowing the user to input the station number? Thanks.

KARL DEWEY said:
If you use Like "*" & [Station #] & "*" you will get all
stations.

For station #2 use Like "*" & [Station #2] & "*".


--
KARL DEWEY
Build a little - Test a little


:

I've read just about every message regarding using Wildcards with a
parameter
query but am still having problems. In my parameter query I input
"Station
#2" but I get all the stations shown below (Station #7 is coming up
because
"L42A" is part of Station #7's string).

Workstation
Station #2 - Hot Plate Weld 04 Nissan ZW
Station #7 - Attach Park Reflector / Bulb Assembly 07 L42A
Station #2 - Hot Plate Weld 04 Nissan

these are my results but I don't want "Station #7".

The criteria I'm using is

"Like "*" & [Station #] & "*".

Is there a way to only get "Station #2" and any text after it, and not
"Station #7". Hope I explained this clearly. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top