Setting MultiSelect Properties to a ListBox at Runtime

G

Guest

From what I can gather from the Access 2002 Help file (see below), this
property CAN be set at Runtime. But I continue to get Error 2448 'You can't
assign a value to this object' Any revelations are greatly appreciated.

Example- To set the MultiSelect property, you can use the following:

Forms("Order Entry").Controls("Country").MultiSelect = 2 ' Extended.
 
A

Allen Browne

Without testing, I would expect that your code would work only if the form
was open in design view.
 
R

Rick Brandt

Access101 said:
From what I can gather from the Access 2002 Help file (see below),
this property CAN be set at Runtime. But I continue to get Error
2448 'You can't assign a value to this object' Any revelations are
greatly appreciated.

Example- To set the MultiSelect property, you can use the following:

Forms("Order Entry").Controls("Country").MultiSelect = 2 ' Extended.

I don't believe it can be changed in Runtime. Would it work for you to have
two ListBoxes in the same form space and toggle which one is visible? Then
you can have one set to Multi-Select and one that is not.
 
G

Guest

That's a good idea.

As a consolation, I would at least like to know why the HELP file would
advocate VBA code for something that can't be changed at runtime. My,
albeit, limited understanding of VBA code, is that it can only be run at
runtime.

What is a neophyte like me not understanding?
 
D

Douglas J. Steele

Lots of things have been lost in the Help file since Access 97 (arguably the
best Access help file).

There, it explicitly states "This property can be set only in form Design
view."
 

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