Connecting Tech Pros Worldwide Forums | Help | Site Map

IIF Statements and filtering

Member
 
Join Date: May 2007
Location: Sheffield
Posts: 34
#1: May 30 '07
Hi, hope you can help me with this.

I am using the following IIF statement in a query to filter out data. I need to filter by site: a, b, c, or No Filter (where No Filter returns all data).

IIf([Forms]![frm FVQ main]![Site]="No Filter",Is Not Null,[Forms]![frm FVQ main]![Site])

[Forms]![frm FVQ main]![Site] is a combo box where 'No Filter' is one of the options. When someone selects 'No Filter' i need to return data from all sites. I thought that using 'Is not Null' would return all data but unfortunately it does not.

Hopefully there is an easy solution to this, however i am lost.

I am using Access '97.

Thanks in advance

puppydogbuddy's Avatar
Expert
 
Join Date: May 2007
Location: Florida
Posts: 1,915
#2: May 30 '07

re: IIF Statements and filtering


Quote:

Originally Posted by jonosborne

Hi, hope you can help me with this.

I am using the following IIF statement in a query to filter out data. I need to filter by site: a, b, c, or No Filter (where No Filter returns all data).

IIf([Forms]![frm FVQ main]![Site]="No Filter",Is Not Null,[Forms]![frm FVQ main]![Site])

[Forms]![frm FVQ main]![Site] is a combo box where 'No Filter' is one of the options. When someone selects 'No Filter' i need to return data from all sites. I thought that using 'Is not Null' would return all data but unfortunately it does not.

Hopefully there is an easy solution to this, however i am lost.

I am using Access '97.

Thanks in advance

Your "NoFilter" selection has no site association, and therefore, is commonly referred to as the "extra row" that needs to specially handled as described in this thread. http://www.thescripts.com/forum/thread652627.html
Member
 
Join Date: May 2007
Location: Sheffield
Posts: 34
#3: May 30 '07

re: IIF Statements and filtering


Thank you very much !!
Reply