I'm trying to create a query with criteria off of a form. I have the following expression in the Field section of the query:
IIf([forms]![frm_data_export]![CB_Date_Type]="Eff Date",[Date_Effective]>="#" & [forms]![frm_data_export]![TB_Date5] & "#" And [Date_Effective]<="#" & [forms]![frm_data_export]![TB_Date6] & "#",[Date_Effective] Is Null Or [Date_Effective] Is Not Null)
This is designed to pull all records between the dates of [TB_Date5] and [TB_Date6]. However, if [CB_Date_Type]<>"Eff Date", then records for all dates are to be pulled.
When I run the query, I get an error message stating "This expression is typed incorrectly, or it is too complex to be evaluated."
Any ideas where I've gone wrong? What should I put in the criteria field for this column?
-illini
IIf([forms]![frm_data_export]![CB_Date_Type]="Eff Date",[Date_Effective]>="#" & [forms]![frm_data_export]![TB_Date5] & "#" And [Date_Effective]<="#" & [forms]![frm_data_export]![TB_Date6] & "#",[Date_Effective] Is Null Or [Date_Effective] Is Not Null)
This is designed to pull all records between the dates of [TB_Date5] and [TB_Date6]. However, if [CB_Date_Type]<>"Eff Date", then records for all dates are to be pulled.
When I run the query, I get an error message stating "This expression is typed incorrectly, or it is too complex to be evaluated."
Any ideas where I've gone wrong? What should I put in the criteria field for this column?
-illini