Wildcard Queries

JVermast

Registered User.
Local time
Today, 06:14
Joined
Jun 15, 2005
Messages
70
I am running a query that links to a "wildcard" form so that the user can basically run a query filtered on any field they want.

For some reason when I try to use wildcards along with Criteria in my query the query will not return any results. I know the link to the textbox is right because if I take out the wildcard and put an exact word from the table I get a result.

I have tried using many different combinations inclusive of the following:

Like [Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]
Like "[Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]"
"[Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]"
[Forms]![Refurb-WildcardReport]![RefurbWildcard-Name]

Any help would be appreciated, as always thank you ahead of time.
 
How about:
Like "*" & [Forms]![Refurb-WildcardReport]![RefurbWildcard-Name] & "*"
 
That worked for the wildcard (simply * in the search box) but returned no results when searching for a specific record. Say "G4"
 
Ah there we go, I used

Like [Forms]![Refurb-WildcardReport]![RefurbWildcard-Set]

Maybe I had the syntax wrong before
 
I have another question on this topic, I also have dates that I want to be wildcarded, I have tried using just a simple * for the "Between [field] and [field]" to get "Between * and *" but this does not work as I had hoped.

Is there a special way to do a wildcard for a date?
 
JVermast said:
I have another question on this topic, I also have dates that I want to be wildcarded, I have tried using just a simple * for the "Between [field] and [field]" to get "Between * and *" but this does not work as I had hoped.

Is there a special way to do a wildcard for a date?

i have not tried this myself, but here's what MS has to say about date wildcards.

http://office.microsoft.com/en-us/assistance/HP051881851033.aspx
 
sorry....i read your question too quickly...you're right, it talks about LIKE but not between....my bad :o
 
I did a bit of reading, seems between date wildcards a bit of a mystery in the access world.
 
JVermast said:
I did a bit of reading, seems between date wildcards a bit of a mystery in the access world.

Nope.
Between And is used to search for dates within a specific range.
Wildcards are only used combined with the LIKE operator.
So what you're after doesn't make sense :D

RV
 
I'm saying that doing something like this "Between * and *" for a date has never been done and the only way people can figure out how to do such a "wildcard" is to use "Between 1/1/1000 and 1/1/3000" therefore including all dates possible for computing and then some.

In my case, I am using a range of dates to search, but by default I need it to return ALL DATES so that the filter is not biased towards a certain date range by default.

Do you have any suggestions as to how I could accomplish this? When I try to put said dates from above as the default, they change to "1/1/1899" when I reopen the form.
 
I'm also wondering if there is a wildcard for a checkbox, if anyone can answer that.
 
how do you have your checkboxes setup? checkboxes are usually Y/N, T/F, On/Off. if you have this then why not use and If/Else. it would be only one or the other, no range of options.
 
I need the check box to return all results if its say...in the thirdstate, and the individual status whether its 1 or 0
 
Last edited:
JVermast said:
I need the check box to return all results if its say...in the thirdstate, and the individual status whether its 1 or 0


in the table design look at the checkbox field. under format at the bottom it will say Yes/No or True/False or On/Off. if it is setup as Yes/No then in your query do something like this:
Code:
SELECT Table1.checkbox
FROM Table1
WHERE (((Table1.checkbox)=No));
or
Code:
SELECT Table1.checkbox
FROM Table1
WHERE (((Table1.checkbox)=yes));

not sure what you mean by thirdstate...sorry about my if/then statement earlier, i'm used to VBA not straight queries....
 
I think you are misunderstanding what I am saying. I basically need 3 outputs. 1 output describes ALL of the records with ANY status in my check box field. I was hoping to use the "thirdstate" option of a checkbox (puts a gray square in it).

The other 2 (0/1) are straightforward and bring back the records that are on and off respectively.
 

Users who are viewing this thread

Back
Top Bottom