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
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