Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change listbox from MultiSelect to regular listbox with code.

Status
Not open for further replies.

kramerica

Technical User
Jun 19, 2001
74
0
0
US
I have a listbox displaying data. Initially the listbox is setup as 'Multiselect' - so that multiple items can be reported on. On one of my summary reports I want to disable the multiselect.

When I use the code.

mslist.multiselect = 0

I get a run-time error 2448 - you can't assign a value to this object.

Any idea's? I know I can count to see if they selected more than one, but I would rather change the property of the listbox on the fly so that they can't choose more than 1 item for this report.
 
kramerica,

This is from Access Help:

This property can be set only in form Design view.

It looks like you can't do it through code, although they give an example of it!?! Back to the drawing board.

Randy
 
What I ended up doing is loop through to see if they clicked more than one, if they did I pop up a msgbox indicating that this report can only run with 1 item selected.

Thanks Randy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top