parameter queries & wildcards

M

mk

I have a two-part problem and would be greatly
appreciative for any advice on how to solve them.

First - I have a parameter query based on a custom dialog
box which has all of the possible fields of the table
being searched. I was hoping to be able to have a user
place a search expression in any of these and have the
query run off that, but it is running off of all of the
fields - including the ones left blank. Is there a way
that I can have the query run based only on the criteria
entered, ignoring the blank fields?

Second - The criteria entered searches fine, however
adding wildcards in the dialog box does not apply the
wildcard. Is there some way that I have to activate the
fields for wildcard use?

Thanks

Mike
 
R

Rick B

To answer your first question, change the parameter in your query to
something like...

Like [Forms]![ReportParameters]![EnterUserID] & "*"

This would result in Like "SMITHJOH*" if "SMITHJOH" were
entered in the field. If the user leaves it blank the result would be
Like "*" which would basically ignore that criteria.

In answer to your second question, follow the steps mentioned in the first
issue above and the users will be able to leave a field blank for all, or
enter only a partial entry. For example, if they want all Smitths, they
could just enter "SMITH" and the query would search as.. Like
"SMITH*"


I do not know of a way for the user to put wildards anywhere they please.


Hope that helps.

Rick B




I have a two-part problem and would be greatly
appreciative for any advice on how to solve them.

First - I have a parameter query based on a custom dialog
box which has all of the possible fields of the table
being searched. I was hoping to be able to have a user
place a search expression in any of these and have the
query run off that, but it is running off of all of the
fields - including the ones left blank. Is there a way
that I can have the query run based only on the criteria
entered, ignoring the blank fields?

Second - The criteria entered searches fine, however
adding wildcards in the dialog box does not apply the
wildcard. Is there some way that I have to activate the
fields for wildcard use?

Thanks

Mike
 

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

Top