Report Text Box question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box on my report that has the following control source:

=IIf(Forms!frmReportSelect!cboDept="","All",Forms!frmReportSelect!cboDept)

What I want it to show is the word "All" when the cboDept is left blank. The
underlying query works and lists all records when the cboDept is left blank
but now I want the word "All" to appear when this instance occurs. When a
dept is selected from the combo box it does show that dept in the text box.

I thought what I wrote above will work but it doesn't work for the true
value of the IIf statement.
 
It could be that the combo box is actually Null and not a zero length string
(" "). You might try this;

=IIf(IsNull(Forms!frmReportSelect!cboDept),"All",Forms!frmReportSelect!cboDept)

HTH
 
Blank usually isn't "". It's probably a Null. Try this:

IIf(IsNull(Forms!frmReportSelect!cboDept) = True, "All",
Forms!frmReportSelect!cboDept)
 
Thanks Jerry! That was what I was looking for.

Jerry Whittle said:
Blank usually isn't "". It's probably a Null. Try this:

IIf(IsNull(Forms!frmReportSelect!cboDept) = True, "All",
Forms!frmReportSelect!cboDept)
 
Back
Top