Dougalsworld
Paul
- Local time
- Today, 09:22
- Joined
- Jul 29, 2005
- Messages
- 62
Hello
below is the code I am using to update multiple records on a sub form so that QtyReceived=QtyOrdered when you click the ReceiveButton, now my understanding of VBA is a little limited and the code I'm using won't work in my main form "frmReceiving" only in the subform "frmReceivingSubform" can anyone see what I'm doing wrong?
Private Sub ReceiveButton_Click()
Dim rs As DAO.Recordset
Set rs = Me.frmReceivingSubform.RecordsetClone
With rs
.MoveFirst
Do While Not .EOF
If rs("QtyReceived") = 0 Then
.Edit
rs("QtyReceived") = [QtyOrdered]
.Update
End If
.MoveNext
Loop
.Close
End With
Set rs = Nothing
End Sub
Thanks
below is the code I am using to update multiple records on a sub form so that QtyReceived=QtyOrdered when you click the ReceiveButton, now my understanding of VBA is a little limited and the code I'm using won't work in my main form "frmReceiving" only in the subform "frmReceivingSubform" can anyone see what I'm doing wrong?
Private Sub ReceiveButton_Click()
Dim rs As DAO.Recordset
Set rs = Me.frmReceivingSubform.RecordsetClone
With rs
.MoveFirst
Do While Not .EOF
If rs("QtyReceived") = 0 Then
.Edit
rs("QtyReceived") = [QtyOrdered]
.Update
End If
.MoveNext
Loop
.Close
End With
Set rs = Nothing
End Sub
Thanks
Last edited: