Multi-Select SQL

D

DS

I'm chosing records from a listbox, If I choose one record. It works
fine. But If I do a Multi-Select then only the last Record I select
gets inserted. How do I make this code accept Multiple Selections?
Thanks
DS

CurrentDb.Execute "Insert into MenuInfo (MenuID,MenuCatID) " & _
"Values(" & Forms!MenuMaker!MenuID & "," &
Me.ListNewSection.Column(1) & ")"
 
D

David Mueller

You need to loop through the selected items of the listbox. Here's some
ugly psuedocode that might help... sorry it's so ugly.

For Each Variant in Listbox.ItemsSelected (I think it's itemsselected)

'Build SQL by specifying each row ListNewSection.Column(columnyouwant,
Variant)
'Execute

Next
 
D

DS

David said:
You need to loop through the selected items of the listbox. Here's some
ugly psuedocode that might help... sorry it's so ugly.

For Each Variant in Listbox.ItemsSelected (I think it's itemsselected)

'Build SQL by specifying each row ListNewSection.Column(columnyouwant,
Variant)
'Execute

Next


:
OK, I'll have play around with this...so I guess looping is the answer?
Thanks
DS
 
Top