Hi all
I'm working on a report that shows transaction by various cashiers within a user-specified date range.
The cashier name ([Cashier]), starting date ([StartDate]), and ending date ([EndDate]) are all selected by a user on a form ([Frm_Search]), which then runs a query ([Qry_Main]) to show matching records.
Inputing a starting and ending date is required, but if a cashier is not selected then results for all cashiers are shown for the date range.
I'd like a text box in the report header to read "Report for [Cashier] from [StartDate] to [EndDate]." And if no cashier is selected on the form, then the message will read "Report for all cashiers from [StartDate] to [EndDate]."
In my text box I currently have the following expression:
=IIf(IsNull([Forms]![Frm_Search]![Cashier]),"Report for all cashiers from " & [Forms]![Frm_Search]![StartDate] & " to " & [Forms]![Frm_Search]![EndDate],"Report for " & [Forms]![Frm_Search]![Cashier] & " from " & [Forms]![Frm_Search]![StartDate] & " to " & [Forms]![Frm_Search]![EndDate])
This successfully shows the date range that's specified by the user on the form, but no matter what I do it always reads "all cashiers" instead of specific [Cashier] names when they are selected. What am I doing wrong?
Thanks!