Passing listbox selected values to NEW table row

G

Gator

I want to add a new record to a table based on rows selected in a ListBox.
I'm using the following code so far...

Private Sub List7_Click()

Dim mycon As New ADODB.Connection
Dim ADOrs As New ADODB.Recordset
Set mycon = CurrentProject.Connection
ADOrs.Open "TreasurerDeposits", mycon, adOpenKeyset, adLockOptimistic
ADOrs.AddNew
ADOrs!Type = List7.Column(0)
ADOrs!Source = List7.Column(1)
ADOrs!Type = List7.Column(2)
ADOrs.Update
ADOrs.Close
mycon.Close
End Sub

This does not work...and I'm sure it's my code. Can somebody polish this
for me?

thanks
 

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