Multiselect listbox

liam_conor

Board Regular
Joined
Oct 9, 2002
Messages
180
Using an add data form and a listbox...

Is it possible for multiple items to be selected in a listbox and those multiple items are returned to the database? Any examples?

(y)
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Basically what I need to do is...

The user will select multiple items from a multiselect list box on a form and click on a command button. At that time the values that were selected in the multiselect list box will be stored in a temporary variable. A textbox, on the form, value will be set to this temporary variable. When the user cilcks another command button the value in the textbox will be sent to the database. Any examples?
 
Upvote 0
I know that there's a Multi-Select Option in the Combo's Properties. Never used it before, I don't know if by default it would treat each selection as a separate entity or if you could capture it all in one variable. Either way, I'm sure that you could write a pretty simple function to send the results to a table.
 
Upvote 0
"List boxes also have a MultiSelect property that allows the user to select multiple items from the control. When multiple selections are made in a list box, you can determine which items are selected by using the Selected property of the control. The Selected property is an array of values from 0 to the ListCount property value minus 1. For each item in the list box the Selected property will be True if the item is selected and False if it is not selected."
-Access VBA Help Files
 
Upvote 0
I am new to VBA for Access. Could you elaborate? I have looked online, using Google, but I cannot find simple examples of VBA code for Access. I can find tons of examples for Excel but not for Access.
 
Upvote 0

Forum statistics

Threads
1,221,590
Messages
6,160,668
Members
451,662
Latest member
reelspike

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top