Hello, I have a command button to find an invoice number that works the way it should when I test it a single form. When the same form is moved to a subform of another form the find dosen't seem to do anything.
I get the Msgbox and can input the number but then it just sets the focus to the Invoice_No field without finding anything.
Private Sub cmdFind_Click()
Dim InvoiceToFind As String
Me.Invoice_No.SetFocus
InvoiceToFind = _
InputBox("Enter the Invoice Number", "Find Invoice")
On Error Resume Next
DoCmd.FindRecord InvoiceToFind
If InvoiceToFind <> Invoice_No Then
MsgBox "The record wasn't found." & Chr(10) & "Please try again."
End If
End Sub
Do I have to do something different with the code?
Thanks in advance
I get the Msgbox and can input the number but then it just sets the focus to the Invoice_No field without finding anything.
Private Sub cmdFind_Click()
Dim InvoiceToFind As String
Me.Invoice_No.SetFocus
InvoiceToFind = _
InputBox("Enter the Invoice Number", "Find Invoice")
On Error Resume Next
DoCmd.FindRecord InvoiceToFind
If InvoiceToFind <> Invoice_No Then
MsgBox "The record wasn't found." & Chr(10) & "Please try again."
End If
End Sub
Do I have to do something different with the code?
Thanks in advance