P
Pete
Re Access 2003
I have a parent form that provides criteria for a subform, which is based on
a parameterised query. The criteria includes two date textboxes: Start & End.
I would like the query to return all records if the 2 date textboxes are
blank:-
Like "*"
Or, if two dates entered, use:-
Between [Forms]![frmPO_TotalsBySupplierAndDateRange]![txtStartDate] And
[Forms]![frmPO_TotalsBySupplierAndDateRange]![txtEndDate]
I have entered the following string into the criteria row of the relevant
date field:-
IIf(IsNull([Forms]![frmPO_TotalsBySupplierAndDateRange]![txtStartDate]),
"Like '*'","Between
[Forms]![frmPO_TotalsBySupplierAndDateRange]![txtStartDate] And
[Forms]![frmPO_TotalsBySupplierAndDateRange]![txtEndDate]")
.... but I get the message:
"This expression is typed incorrectly, or it is too complex to be evaluated."
Is there any way I can get this to work using a single query, or will I have
to create a second query and hot-swap the RecordSource, based on a value
being present in the date fields or not?
Many thanks.
Pete.
I have a parent form that provides criteria for a subform, which is based on
a parameterised query. The criteria includes two date textboxes: Start & End.
I would like the query to return all records if the 2 date textboxes are
blank:-
Like "*"
Or, if two dates entered, use:-
Between [Forms]![frmPO_TotalsBySupplierAndDateRange]![txtStartDate] And
[Forms]![frmPO_TotalsBySupplierAndDateRange]![txtEndDate]
I have entered the following string into the criteria row of the relevant
date field:-
IIf(IsNull([Forms]![frmPO_TotalsBySupplierAndDateRange]![txtStartDate]),
"Like '*'","Between
[Forms]![frmPO_TotalsBySupplierAndDateRange]![txtStartDate] And
[Forms]![frmPO_TotalsBySupplierAndDateRange]![txtEndDate]")
.... but I get the message:
"This expression is typed incorrectly, or it is too complex to be evaluated."
Is there any way I can get this to work using a single query, or will I have
to create a second query and hot-swap the RecordSource, based on a value
being present in the date fields or not?
Many thanks.
Pete.