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
 

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

Similar Threads


Top