G
Guest
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
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