G
Guest
What I want to do:
I want to simulate the "no criteria" scenario in my true expression of my IF
statement, I.e. if the condition is true, the critria for the query is such
that there is no criteria (as if I left the critria row blank in query design
view).
Let me explain:
The user select a value from a combobox (which gets its values from a query
that only list unique values) and the query list all the records where this
value is found - BUT if the user DOESN'T select any value -> the query list
all records from the original table (including records with NULL values) -
this should be like having a query with no criteria set.
I frist tried leaving the true part of the IF statement empty - that's not
allowed and "*" or [] etc. also doesn't give the desired result.
I then tried:
IIf(IsNull([Forms]![TestRecords_Query]![Personnel]),[TestRecords]![Personnel],[Forms]![TestRecords_Query]![Personnel])
Here the true part list all the records from the original table but
unfortunately exludes the records where [Personnel] is left empty (null).
Hope someone can help.
I want to simulate the "no criteria" scenario in my true expression of my IF
statement, I.e. if the condition is true, the critria for the query is such
that there is no criteria (as if I left the critria row blank in query design
view).
Let me explain:
The user select a value from a combobox (which gets its values from a query
that only list unique values) and the query list all the records where this
value is found - BUT if the user DOESN'T select any value -> the query list
all records from the original table (including records with NULL values) -
this should be like having a query with no criteria set.
I frist tried leaving the true part of the IF statement empty - that's not
allowed and "*" or [] etc. also doesn't give the desired result.
I then tried:
IIf(IsNull([Forms]![TestRecords_Query]![Personnel]),[TestRecords]![Personnel],[Forms]![TestRecords_Query]![Personnel])
Here the true part list all the records from the original table but
unfortunately exludes the records where [Personnel] is left empty (null).
Hope someone can help.