table insertion based og listbox selection

S

spstieng

Hi, I've looked and tried - but can't make it work.



I have a multi listbox 'lbCustomerList' which list 'CustomerID' and
customer 'Name' from a table called 'Clients'.

I select multiple customers and press 'Create Invoice' button.



When I press the button, the selected customers will be inserted into a
table called 'Invoice'



I'm kind of on the right track.... just not quite...

Here some of the code:



Set frm = Form!Form_Form1 (have not named the form yet)

Set ctl = frm!lbCustomerList



For Each varItem In ctl.ItemsSelected

strSQL = "INSERT INTO Invoice valuse (CustomerID)"

{here I want to execute the SQL statement}

Next varItem





Any help appreciated
 

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

Top