Multiple Values in Single Recordset

AcceSs-AbLe

Board Regular
Joined
Jan 27, 2003
Messages
87
Hi,

I have a list box which contains multiple values for the user to select. These values are stored in a recordset. However, my problem is that when the user selects single value, the value is stored in the table, if there is more than 1 selection, nothing is stored in the recordset. How would I accomplish this?

Thank you!!!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
I came up with the following code which produces the results but I still can't figure out how to put this into a cell(recordset)

Sub BoundData()
Dim frm As Form, ctl As Control
Dim varItm As Variant
Dim rs As Recordset
Set frm = Forms!Form1
Set ctl = frm!List0
For Each varItm In ctl.ItemsSelected
Debug.Print ctl.ItemData(varItm)
rs.Update ctl.ItemData(varItm)----this doesnt work
Next varItm

End Sub
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,327
Members
451,697
Latest member
pedroDH

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