Is it possible to adjust the multi select property of a list box using VBA?
my initial thaught would be
Me.List43.multi select = simple
but this produces an error.
6 12640
I have discovered that the way to set this particular property is:
Me.List43.MultiSelect = 1
however, this tells me that "You cant assign a value to this object"
Is it not possible to change the value of Multi Select on a list box?
this will seriously mess my project up if you cant since I need to be able to have the option to select one, or many for a list box.
I could probably get round this by having both a multiselect and a single select box on the form overlapping eachother, and hide the un-needed one so that only the needed one appears and is usuable, but this seems a little long winded for something that seems quite basic.
I have discovered that the way to set this particular property is:
Me.List43.MultiSelect = 1
however, this tells me that "You cant assign a value to this object"
Is it not possible to change the value of Multi Select on a list box?
this will seriously mess my project up if you cant since I need to be able to have the option to select one, or many for a list box.
I could probably get round this by having both a multiselect and a single select box on the form overlapping eachother, and hide the un-needed one so that only the needed one appears and is usuable, but this seems a little long winded for something that seems quite basic.
Hi
Extract from Access Help
Note You can set the MultiSelect property by using the list box's property sheet, a macro, or Visual Basic.
This property can be set only in form Design view.
So you can set it in code, but only with the form in design state ??
MTB
I have discovered that the way to set this particular property is:
Me.List43.MultiSelect = 1
however, this tells me that "You cant assign a value to this object"
Is it not possible to change the value of Multi Select on a list box?
this will seriously mess my project up if you cant since I need to be able to have the option to select one, or many for a list box.
I could probably get round this by having both a multiselect and a single select box on the form overlapping eachother, and hide the un-needed one so that only the needed one appears and is usuable, but this seems a little long winded for something that seems quite basic.
You can change the Value of the MultiSelect Property, but it is not exactly intuitive how to do so:- It can only be changed in Design Mode.
- You must use the Absolute Reference to the List Box as in:
- Const conNone As Integer = 0
-
Const conSimple As Integer = 1
-
Const conExtended As Integer = 2
-
-
DoCmd.OpenForm "Form1", acDesign, , , , acHidden
-
'Forms!Form1!lstMultiSelect.MultiSelect = conNone
-
'OR
-
'Forms!Form1!lstMultiSelect.MultiSelect = conSimple
-
'OR
-
'Forms!Form1!lstMultiSelect.MultiSelect = conExtended
-
DoCmd.OpenForm "Form1", acNormal, , , acFormEdit, acWindowNormal
- Any other questions, feel free to ask.
Yea, i read that and it seemed a little strange.
Im not sure why you would program the state of an object using vba while your in edit mode.
I resorted to having the 2 list boxes overlapping, it works fine but seems a little unecesary...
Thanks ADezii,
unfortunately havign it change only when in design is not useful for this particular application. i managed a work arround though so its ok.
The more I use access VBA the more i think its unecesarily complicated.
Thanks ADezii,
unfortunately havign it change only when in design is not useful for this particular application. i managed a work arround though so its ok.
The more I use access VBA the more i think its unecesarily complicated.
Thanks ADezii,
unfortunately havign it change only when in design is not useful for this particular application.
You are quite welcome. Just for curiosity, why would you want to dynamically change the MultiSelect Property, and why isn't it usefull for your particular Application?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: ColinWard |
last post by:
I have a multi- select list box on my form. It works fine except that I
have to click on every value I want to select. Is there a way to make
the multi-select list box behave so that when you hold...
|
by: NYprmr |
last post by:
Hi All,
I'm trying to get value from Listbox where Multi Select property is
set to Simple, meaning multiple values can be selected.
Doing regular loop like following, retuns NULL value for each...
|
by: google |
last post by:
Hello everyone,
I am having an issue using the "Multi Select" option in a list box
in MS Access 2003. I am making a form that users can fill out to add
an issue to the database. Each issue can...
|
by: dkelly925 |
last post by:
Is there a way to add an If Statement to the following code so if data
in a field equals "x" it will launch one report and if it equals "y" it
would open another report. Anyone know how to modify...
|
by: Matthew Wells |
last post by:
I have a listbox set to simple multi select. For this example, users only
select one item at a time. I have command buttons on the form for First,
Previous, Next, Last, New (record). The form...
|
by: dbuchanan |
last post by:
There are three parts to this
1.) How do I cascade menus?
2.) And, how do I cascade menus with a multi-select CheckBoxList?
|
by: woodey2002 |
last post by:
This problem is driving me crazy.
Hello there,
i am trying to create a search form for records in my access database. The search form will contain text boxes and a multi select list box. The user...
|
by: woodey2002 |
last post by:
Hi Everyone. Thanks for your time.
I am trying to create a search form that will allow users to select criteria from multiple multi select boxes. So far i have managed to achieve a search option...
|
by: usr123 |
last post by:
Hi,
I need a multi select combo box on ASP page.
Scenario: on page there is a table with few columns. In multi select box, i need all the table columns,let user select a few, and show only...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |