I have a form that gets data from a query. The query might have many records; therefore, the form has the same number of records.
I made a Command Button on the form to transfer the current record data that I am viewing, to a table. Thus, only the data I am viewing is supposed to be transferred.
The problem I am having is regardless of what record I am viewing, only the 1st record is transferred. I guess I don't know how to do this procedure! I appreciate any input that you might provide.
Here is my code:
Private Sub Accept_DblClick(Cancel As Integer)
Dim db As Database
Dim rst1 As Recordset
Dim rst2 As Recordset
Set db = CurrentDb
Set rst1 = db.OpenRecordset("Table1"
Set rst2 = db.OpenRecordset("qryListOfNeededReviewedDocs"
rst1.AddNew
rst1!DocNumber = 1
rst1!ReviewStatus = "Accepted"
rst1.Update
'rst2.AddNew
Msgbox rst2!DocNumber
'rst2!DocNumber= rst2!DocNumber
'rst2.Update
rst1.Close
rst2.Close
db.Close
End Sub
Thanks
East or West Home is Best.
I made a Command Button on the form to transfer the current record data that I am viewing, to a table. Thus, only the data I am viewing is supposed to be transferred.
The problem I am having is regardless of what record I am viewing, only the 1st record is transferred. I guess I don't know how to do this procedure! I appreciate any input that you might provide.
Here is my code:
Private Sub Accept_DblClick(Cancel As Integer)
Dim db As Database
Dim rst1 As Recordset
Dim rst2 As Recordset
Set db = CurrentDb
Set rst1 = db.OpenRecordset("Table1"
Set rst2 = db.OpenRecordset("qryListOfNeededReviewedDocs"
rst1.AddNew
rst1!DocNumber = 1
rst1!ReviewStatus = "Accepted"
rst1.Update
'rst2.AddNew
Msgbox rst2!DocNumber
'rst2!DocNumber= rst2!DocNumber
'rst2.Update
rst1.Close
rst2.Close
db.Close
End Sub
Thanks
East or West Home is Best.