I have a form which allows a user to search for invoices by supplier/number or by username. Both searches are run from a command button, and the code can for both can be found below
Private Sub Find_Invoice_Click() Dim stDocName As String Dim stLinkCriteria As String stDocName = "Invoice Log Table 4" stLinkCriteria = "InvoiceNo = " & "'" & Me.InvoiceNo.Value & "'" & " And Supplier Name = " & "'" & Me.Supplier_Name.Value & "'" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Find_Invoice_Click: Exit Sub Err_Find_Invoice_Click: MsgBox Err.Description Resume Exit_Find_Invoice_Click End Sub
this one has the following error message: Runtime error 3075, missing operator
Private Sub Command13_Click() On Error GoTo Err_Command13_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Invoice Log Table 4" stLinkCriteria = "Entered by = " & "'" & Me.Entered_by.Value & "'" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command13_Click: Exit Sub Err_Command13_Click: MsgBox Err.Description Resume Exit_Command13_Click End Sub
this one has the "missing operator" error, but w/o the 3075 code. All values being searched are text.
Also, if no match is found, how can i put in a MSG BOX to state that?
Cheers for all ur help in advance.