Solved

How to use wildcard in query criteria

Posted on 2013-06-13
3
650 Views
Last Modified: 2013-06-13
See embedded picture please.
I have a form with controls "display" and "block" with parameter values and a query which uses these parameters in criteria.
The default values of two of the criteria field are * per default.
However the query renders no records under these conditions.
If I put * in the criteria of the query directly, it displays all records, but not when the criteria refers to the appropriate controls on the form.
If I select actual values in the controls, the query renders correctly.
What am I doing wrong. I believe I have done this before.
Picture of form and query
0
Comment
Question by:Fritz Paul
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39244992
try placing  "Like" in front of your criteria. i.e.,

Like Forms!NameOfform!NameOfControl

or

Like Forms!NameOfform!NameOfControl & "*"
0
 
LVL 57
ID: 39245003
In the query, you need to use the Like operator along with the control value or add a column in the query of using the control reference and put an asterick (*) as the criteria.

 So it's either some column = the form control or the form control = "*"

Jim.
0
 

Author Closing Comment

by:Fritz Paul
ID: 39245023
The "Like Forms!NameOfform!NameOfControl" works fine.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now