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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top