Cannot get a Wild Card Query to show Records.

From: titlepusher (titlepusher_at_discussions.microsoft.com)
Date: 03/24/05


Date: Thu, 24 Mar 2005 07:13:06 -0800

Brain Dead.... Ok.. my objective : if the form control field (text box) is
blank show all records, otherwise show the specific record that matches the
value in the text box. I need this for three fields on the same form.

I have a master form with six text boxes to query data from. Three fields(
1,2 and 3) (combo boxes) are easy.. Match the form control exactly) The other
three form controls 4,5, and 6) text boxes) need to be able to be blank or
have data.

I want to be able to construct a query so that If any one of form controls
4,5,6 is blank then return all records for that field and continue to filter
from the other fields.

What I Have Is: In the query design window for instance in field 4

IIF([Forms]![MasterForm]![TxtBx4] Is Null, "*",[Forms]![MasterForm]![TxtBx4])
I repeated this for fields 5 and 6 changing the field names respectively.

I have also changed the syntax to [Forms]![MasterForm]![TxtBx4] &"*"
                                                 
Like*[Forms]![MasterForm]![TxtBx4]
                                                 
[Forms]![MasterForm]![TxtBx4]*
and a host of others.

When I substitute the "[Forms]![MasterForm]![TxtBx4]" part of the statement
for a known value and run it I do get records matching the known value, so I
know that it recognizes when the form control field is blank.

Pulled all of my hair out and my dog is getting nervous.

Help



Relevant Pages

  • Re: Cannot get a Wild Card Query to show Records.
    ... > I have a master form with six text boxes to query data from. ... > I want to be able to construct a query so that If any one of form controls ...
    (microsoft.public.access.queries)
  • Re: Cannot get a Wild Card Query to show Records.
    ... The query will only return ... records when I enter known values into the text boxes. ... >> I want to be able to construct a query so that If any one of form controls ... >> for a known value and run it I do get records matching the known value, ...
    (microsoft.public.access.queries)
  • Re: Cannot get a Wild Card Query to show Records.
    ... > I have a master form with six text boxes to query data from. ... > I want to be able to construct a query so that If any one of form controls ... > Pulled all of my hair out and my dog is getting nervous. ...
    (microsoft.public.access.queries)
  • Re: access 2003
    ... I removed the parameters from the form query source. ... boxes from the form header, events, code, etc and ran the form query source ... forms queries and the SQL because syntax of the SQL will change randomly. ... the Access 97 database, I wouldn't have thought any expressions would be ...
    (microsoft.public.access.conversion)
  • Re: Different data shown based on user input
    ... my advice changes with the info that there are over 200 checkboxes. ... I suggest you use combo boxes. ... Dim strStub As String ...
    (microsoft.public.access.queries)