I'm using the following code to update a table through a recordset. Can anyone see anything wrong with it because its not working
__________________________________
Private Sub Add_Click()
Dim rst As ADODB.Recordset
Dim cnn As ADODB.Connection
Set rst = New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst.Open "Select * from tbl_target", cnn, adOpenDynamic, adLockOptimistic
rst.AddNew
rst.Fields("Date"
= Me.TarDate
rst.Fields("Department"
= Me.dept
rst.Fields("Division"
= Me.Division
rst.Fields("Section"
= Me.Section
rst.Fields("Target"
= Me.AdTarget
rst.Update
rst.Close
Me.Refresh
End Sub
__________________________
thx for any help _______________
Stretchy
__________________________________
Private Sub Add_Click()
Dim rst As ADODB.Recordset
Dim cnn As ADODB.Connection
Set rst = New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst.Open "Select * from tbl_target", cnn, adOpenDynamic, adLockOptimistic
rst.AddNew
rst.Fields("Date"
rst.Fields("Department"
rst.Fields("Division"
rst.Fields("Section"
rst.Fields("Target"
rst.Update
rst.Close
Me.Refresh
End Sub
__________________________
thx for any help _______________
Stretchy