Solved

How to use wildcard in query criteria

Posted on 2013-06-13
3
647 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

24 Experts available now in Live!

Get 1:1 Help Now