Re: Cannot get a Wild Card Query to show Records.
From: Van T. Dinh (VanThien.Dinh_at_discussions.microsoft.com)
Date: 03/24/05
- Next message: Van T. Dinh: "Re: Help on wildcard expression"
- Previous message: Sylvain Lafontaine: "Re: Access2003 query using IIF in calculated field returns negative"
- In reply to: titlepusher: "Cannot get a Wild Card Query to show Records."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Mar 2005 10:48:17 +1100
It sounds to me that you want criteria something like:
WHERE ...
( ( Field4 = [Forms]![MasterForm]![TxtBx4] ) OR
( [Forms]![MasterForm]![TxtBx4] Is Null ) ) AND
( ( Field5 = [Forms]![MasterForm]![TxtBx5] ) OR
( [Forms]![MasterForm]![TxtBx5] Is Null ) ) AND
( ( Field6 = [Forms]![MasterForm]![TxtBx6] ) OR
( [Forms]![MasterForm]![TxtBx6] Is Null ) )
-- HTH Van T. Dinh MVP (Access) "titlepusher" <titlepusher@discussions.microsoft.com> wrote in message news:35A2C14B-8C5E-4647-A0B6-6E65D25FFA5E@microsoft.com... > 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 > > >
- Next message: Van T. Dinh: "Re: Help on wildcard expression"
- Previous message: Sylvain Lafontaine: "Re: Access2003 query using IIF in calculated field returns negative"
- In reply to: titlepusher: "Cannot get a Wild Card Query to show Records."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|