N
NEWER USER
I am trying to update a field 'Order' using the current Recordset of my
subform. I get a Compile error @ rs.Edit - Method or data member not found.
Can anyone tell me WHY and help me correct? Any help appreciated.
Private Sub QF_Click()
Dim rs As Recordset
Dim rsC As Recordset
Dim db As Database
Set db = CurrentDb
Set rs = db.OpenRecordset(Me.fsubSearch.Form.RecordSource)
If rs.RecordCount > 0 Then
If MsgBox("Order Quantity will be updated to Per Car Quantity." &
vbNewLine & vbNewLine & "Continue?", vbYesNo + vbQuestion, "Confirm.") =
vbYes Then
DoCmd.Hourglass True
rs.MoveFirst
While Not rs.EOF
rs.Edit
rs!Order = [Per Car]
rs.Update
rs.MoveNext
Wend
Me.fsubSearch.Form.Requery
DoCmd.Hourglass False
MsgBox rs.RecordCount & " record/s have been updated.",
vbInformation, "Finished."
End If
Else
MsgBox "No record to update.", vbInformation, "Message."
End If
rs.Close
Set db = Nothing
Me.fsubSearch.Form.Requery
End Sub
subform. I get a Compile error @ rs.Edit - Method or data member not found.
Can anyone tell me WHY and help me correct? Any help appreciated.
Private Sub QF_Click()
Dim rs As Recordset
Dim rsC As Recordset
Dim db As Database
Set db = CurrentDb
Set rs = db.OpenRecordset(Me.fsubSearch.Form.RecordSource)
If rs.RecordCount > 0 Then
If MsgBox("Order Quantity will be updated to Per Car Quantity." &
vbNewLine & vbNewLine & "Continue?", vbYesNo + vbQuestion, "Confirm.") =
vbYes Then
DoCmd.Hourglass True
rs.MoveFirst
While Not rs.EOF
rs.Edit
rs!Order = [Per Car]
rs.Update
rs.MoveNext
Wend
Me.fsubSearch.Form.Requery
DoCmd.Hourglass False
MsgBox rs.RecordCount & " record/s have been updated.",
vbInformation, "Finished."
End If
Else
MsgBox "No record to update.", vbInformation, "Message."
End If
rs.Close
Set db = Nothing
Me.fsubSearch.Form.Requery
End Sub