D
DOYLE60
I have a list box on a form that filters a report. It is set up so that if
nothing is chosen in the list box, the report prints all and if items are
chosen, then it just prints those items.
On the report header I have the items chosen in the list box. The control
source has this in it:
=enumrecord("PrintDialogInventoryFranchiseLBqry2")
This all works just fine.
But I want to make a slight change. Instead of listing all items if nothing is
chosen in the listbox, I want it instead to just say "All" in that case.
I tried thing like this:
=IIf([Forms]![InventoryDialogPrintfrm]![FranchiseChosen] Is
Null,"All",enumrecord("PrintDialogInventoryFranchiseLBqry2"))
=IIf(Len([InventoryDialogPrintfrm].[Forms]![FranchiseChosen])=0,"All",enum
record("PrintDialogInventoryFranchiseLBqry2"))
I even attempted to write code in the OnOpen of the report for the control
source of the text box, doing a If-Else statement. But I can't seem to get it.
Any help would be greatly appreceiated.
The dialog Print form is: InventoryDialogPrintfrm
The Listbox is: FranchiseChosen
The Textbox on the report is: Franchisetxt
The query that holds the listbox items is: PrintDialogInventoryFranchiseLBqry2
Thanks again,
Matt
PS: I couldn't find my original question posted yesterday, so this is a rewrite
of that question.
nothing is chosen in the list box, the report prints all and if items are
chosen, then it just prints those items.
On the report header I have the items chosen in the list box. The control
source has this in it:
=enumrecord("PrintDialogInventoryFranchiseLBqry2")
This all works just fine.
But I want to make a slight change. Instead of listing all items if nothing is
chosen in the listbox, I want it instead to just say "All" in that case.
I tried thing like this:
=IIf([Forms]![InventoryDialogPrintfrm]![FranchiseChosen] Is
Null,"All",enumrecord("PrintDialogInventoryFranchiseLBqry2"))
=IIf(Len([InventoryDialogPrintfrm].[Forms]![FranchiseChosen])=0,"All",enum
record("PrintDialogInventoryFranchiseLBqry2"))
I even attempted to write code in the OnOpen of the report for the control
source of the text box, doing a If-Else statement. But I can't seem to get it.
Any help would be greatly appreceiated.
The dialog Print form is: InventoryDialogPrintfrm
The Listbox is: FranchiseChosen
The Textbox on the report is: Franchisetxt
The query that holds the listbox items is: PrintDialogInventoryFranchiseLBqry2
Thanks again,
Matt
PS: I couldn't find my original question posted yesterday, so this is a rewrite
of that question.