D
Darhl Thomason
I have an unbound text box control in the header of my report. I'm trying
to use nested IIF statements to control what it says. Here's what I'm
trying to do: On my form, I have optional text boxes for
txtInstallStartDate and txtInstallEndDate. On my report, if someone puts in
txtInstallStartDate then I want the header to say "[StatusName] since
<txtInstallStartDate>". If someone puts in txtInstallEndDate I want the
header to say "[StatusName] Thru <txtInstallEndDate>". If someone puts in
both dates, I want the header to say "[StatusName] <txtInstallStartDate>
thru <txtInstallEndDate>". If they leave both dates blank, I want the
header to say "[StatusName]".
When I run the report, it responds with error 3075, Syntax error (missing
operator) in query expression and lists my control source, but it's
truncated and doesn't list the entire control source, I'm assuming it's
because it's too long. My control source is listed below.
I was thinking of doing this in my form's module with if/then statements
then pass the value to the report to display, but [StatusName] is a grouping
field for the report so I'm not sure if I can do it. I also don't know if I
can put that kind of code in the report's header.
Thanks for taking a look,
Darhl
iif(isnull(Forms!frmStoreData.txtInstallStartDate),iif(isnull(Forms!frmStoreData.txtInstallEndDate),=[StatusName],=[StatusName]
& " thru " &
[Forms!frmStoreData.txtInstallEndDate]),iif(isnull(Forms!frmStoreData.txtInstallEndDate),=[StatusName]
& " since " & [Forms!frmStoreData.txtInstallStartDate],=[StatusName] &
[Forms!frmStoreData.txtInstallStartDate] & " thru " &
[Forms!frmStoreData.txtInstallEndDate]))
to use nested IIF statements to control what it says. Here's what I'm
trying to do: On my form, I have optional text boxes for
txtInstallStartDate and txtInstallEndDate. On my report, if someone puts in
txtInstallStartDate then I want the header to say "[StatusName] since
<txtInstallStartDate>". If someone puts in txtInstallEndDate I want the
header to say "[StatusName] Thru <txtInstallEndDate>". If someone puts in
both dates, I want the header to say "[StatusName] <txtInstallStartDate>
thru <txtInstallEndDate>". If they leave both dates blank, I want the
header to say "[StatusName]".
When I run the report, it responds with error 3075, Syntax error (missing
operator) in query expression and lists my control source, but it's
truncated and doesn't list the entire control source, I'm assuming it's
because it's too long. My control source is listed below.
I was thinking of doing this in my form's module with if/then statements
then pass the value to the report to display, but [StatusName] is a grouping
field for the report so I'm not sure if I can do it. I also don't know if I
can put that kind of code in the report's header.
Thanks for taking a look,
Darhl
iif(isnull(Forms!frmStoreData.txtInstallStartDate),iif(isnull(Forms!frmStoreData.txtInstallEndDate),=[StatusName],=[StatusName]
& " thru " &
[Forms!frmStoreData.txtInstallEndDate]),iif(isnull(Forms!frmStoreData.txtInstallEndDate),=[StatusName]
& " since " & [Forms!frmStoreData.txtInstallStartDate],=[StatusName] &
[Forms!frmStoreData.txtInstallStartDate] & " thru " &
[Forms!frmStoreData.txtInstallEndDate]))