Like parameter

John Williams

New member
Local time
Today, 22:10
Joined
Apr 2, 2010
Messages
8
Hi
I am using the "like" parameter like"*"&[Enter Invoice]&"*". If I put an invalid or non exsistant invoice in I go to a blank form. Is there a way of giving a message instead of the blank form
 
you can issue a message box on the open event of the form based on frm control
 
You can check the form's recordsource to see if there are any records and cancel the opening if you want:

Code:
Private Sub Form_Open(Cancel As Integer)
  Dim rs As DAO.Recordset
    Set rs = Me.RecordsetClone
       If rs.RecordCount = 0 Then
          MsgBox "There Are No Records", vbInformation
          Cancel = True
       End If
End Sub

(Untested Air Code)
 

Users who are viewing this thread

Back
Top Bottom