Listbox problem

B

Biggles

I am trying to make my list box, depending on how the form is opened, either
select only one or many, so I have this code in my on open of the form (for
this one, to make multiselect none).

Me.Selectapp.MultiSelect = 0
However, the error message I get says that I cannot assign a value to this
object.
Help.
 
R

Rick Brandt

Biggles said:
I am trying to make my list box, depending on how the form is opened,
either select only one or many, so I have this code in my on open of
the form (for this one, to make multiselect none).

Me.Selectapp.MultiSelect = 0
However, the error message I get says that I cannot assign a value to
this object.
Help.

That is a property that cannot be changed in Runtime (only in design view).

Create two ListBoxes, one with MultiSelect enabled and toggle which is
visible.
 
B

Biggles

Thanks, I will do that. Do you know why you cannot change this? At first
glance, seems inefficient.
 
R

Rick Brandt

Biggles said:
Thanks, I will do that. Do you know why you cannot change this? At
first glance, seems inefficient.

No. There are certain properties that simply cannot be changed except in design
view. I do not know the technical reasons.
 
Top