E
Emmy
Sorry, I thought I had this figured out, but I have one more question. I
tried the code and get the message "Compile Error: Next without
For." If I take out the Next, I get a message that there is For without
Next. I must just have something in the wrong spot. Thanks for any help.
This is what I have:
Private Sub CopyInvoiceNumberToAllChecked_Click()
Dim I As Integer
'Move to the first record
DoCmd.GoToRecord , , acFirst
'Create a loop for all the records
For I = 1 To Me.RecordsetClone.RecordCount
With CodeContextObject
DoCmd.SetWarnings False
If (.VendorWasPaid Like "-1") Then
Forms!frmInvoiceReceived!InvoiceNumber =
Forms!frmInvoiceReceived!InvoiceNo
End If
DoCmd.RunCommand acCmdRefresh
DoCmd.GoToRecord , "", acNext
Next I
End With
mcrSetValueInvoiceReceived_Exit:
mcrSetValueInvoiceReceived_Err:
End Sub
tried the code and get the message "Compile Error: Next without
For." If I take out the Next, I get a message that there is For without
Next. I must just have something in the wrong spot. Thanks for any help.
This is what I have:
Private Sub CopyInvoiceNumberToAllChecked_Click()
Dim I As Integer
'Move to the first record
DoCmd.GoToRecord , , acFirst
'Create a loop for all the records
For I = 1 To Me.RecordsetClone.RecordCount
With CodeContextObject
DoCmd.SetWarnings False
If (.VendorWasPaid Like "-1") Then
Forms!frmInvoiceReceived!InvoiceNumber =
Forms!frmInvoiceReceived!InvoiceNo
End If
DoCmd.RunCommand acCmdRefresh
DoCmd.GoToRecord , "", acNext
Next I
End With
mcrSetValueInvoiceReceived_Exit:
mcrSetValueInvoiceReceived_Err:
End Sub