Custom message on report if parameter is null

  • Thread starter Thread starter Kurt
  • Start date Start date
K

Kurt

When a user enters a start and end date on a form (into
txtStartDate and txtEndDate), a report opens and an
unbound text box shows the parameter used. If nothing is
entered in txtStartDate and txtEndDate, "Date Range: None
to None" appears.

Instead of preserving the " " to " " format, I would like
the alternative message to show something like, "Date
Range: All Dates."

My current syntax allows for some customization, but is
limited to a " " to " " format. Any ideas how I can edit
it?

Thanks. - Kurt

Current syntax:
 
What about:
=IIF([txtStartDate] is null and [txtEndDate] is null,"All
Dates", "Date Gange: From "& [txtStartDate] & " To " &
[txtEndDate]
Hope this helps.
Fons
 
This syntax works perfectly, but I had to add two hidden
text boxes on the report (txtStartDate and txtEndDate),
with a Control Source of
=Forms.frmnuReportSelect.txtStartDate and
=Forms.frmnuReportSelect.txtEndDateDate, respectively.
Otherwise, the syntax created two parameter pop up boxes
for txtStartDate and txtEndDate.

Thanks! - Kurt

-----Original Message-----
What about:
=IIF([txtStartDate] is null and [txtEndDate] is null,"All
Dates", "Date Gange: From "& [txtStartDate] & " To " &
[txtEndDate]
Hope this helps.
Fons
-----Original Message-----
When a user enters a start and end date on a form (into
txtStartDate and txtEndDate), a report opens and an
unbound text box shows the parameter used. If nothing is
entered in txtStartDate and txtEndDate, "Date Range: None
to None" appears.

Instead of preserving the " " to " " format, I would like
the alternative message to show something like, "Date
Range: All Dates."

My current syntax allows for some customization, but is
limited to a " " to " " format. Any ideas how I can edit
it?

Thanks. - Kurt

Current syntax:
---------------
="Date Range: " & Nz
(Forms.frmnuReportSelect.txtStartDate,"None") & " to " &
Nz(Forms.frmnuReportSelect.txtEndDate,"None")




.
.
 
Thanks. Sorry for my typo Gange vs Range.
Take care
-----Original Message-----
This syntax works perfectly, but I had to add two hidden
text boxes on the report (txtStartDate and txtEndDate),
with a Control Source of
=Forms.frmnuReportSelect.txtStartDate and
=Forms.frmnuReportSelect.txtEndDateDate, respectively.
Otherwise, the syntax created two parameter pop up boxes
for txtStartDate and txtEndDate.

Thanks! - Kurt

-----Original Message-----
What about:
=IIF([txtStartDate] is null and [txtEndDate] is null,"All
Dates", "Date Gange: From "& [txtStartDate] & " To " &
[txtEndDate]
Hope this helps.
Fons
-----Original Message-----
When a user enters a start and end date on a form (into
txtStartDate and txtEndDate), a report opens and an
unbound text box shows the parameter used. If nothing is
entered in txtStartDate and txtEndDate, "Date Range: None
to None" appears.

Instead of preserving the " " to " " format, I would like
the alternative message to show something like, "Date
Range: All Dates."

My current syntax allows for some customization, but is
limited to a " " to " " format. Any ideas how I can edit
it?

Thanks. - Kurt

Current syntax:
---------------
="Date Range: " & Nz
(Forms.frmnuReportSelect.txtStartDate,"None") & " to " &
Nz(Forms.frmnuReportSelect.txtEndDate,"None")




.
.
.
 
Back
Top