I am having a hard time for some reason. I have a search textbox with a button to search. Right now if you put some bogus number in there is returns a value that is not the correct value. Works fine if you type in the correct value though.
Anyway how do you say if the value you entered is not the records then Exit Sub and send messagbox? And do you put that at the very end of the IF statement?
Here is what I have that is not working.
Anyway how do you say if the value you entered is not the records then Exit Sub and send messagbox? And do you put that at the very end of the IF statement?
Here is what I have that is not working.
Code:
Private Sub cmdFind_Click() On Error GoTo errHandle Dim records As Recordset If Nz(txtPOSearch.value, "") = "" Then Forms!frmMain!frmAll.Form.Filter = "tblInformation.PO = 0" Forms!frmMain!frmAll.Form.FilterOn = True ElseIf records.EOF Then Exit Sub Else 'If Not Me.Recordset.EOF Then Exit Sub Forms!frmMain!frmAll.Form.Filter = "tblInformation.PO = " & txtPOSearch.value Forms!frmMain!frmAll.Form.FilterOn = True End If Exit Sub
Comment