if No selection on multiselection box then print all in listbox.

G

Gwen

Hi,
Please assist.
I am using a multiselection listbox that enters the bound column of the all
selections in a text box.

However if the user does not make a selection, I want everything in listbox
to be displayed in the report.

I have tried me.listbox.itemselected = false
then
DoCmd.OpenForm stDocName
else
DoCmd.OpenReport stDocName, acViewPreview, , stlinkcriteria
end if.
Doesn't work

Thanks
 
S

Sandra Daigle

Try checking the count property of the .ItemsSelected collection:

if me.listbox.itemselected.count =0 then
DoCmd.OpenForm stDocName
else
DoCmd.OpenReport stDocName, acViewPreview, , stlinkcriteria
end if
 
Top