Method or data number not found

meenctg

Learn24bd
Local time
Tomorrow, 04:56
Joined
May 8, 2012
Messages
133
I create a VB program in my report that when search data won't exist then it 'll give "Your entered data is invalid or reult not found" but here a problem
that is Method or data number not found

My program

Code:
  Private Sub Report_Open(Cancel As Integer)
    On Error Resume Next
        If Me.RecordsetClone.RecordCount = 0 Then
        DoCmd.CancelEvent
        MsgBox "Your entered data is invalid or reult not found", , "Sorry!"
        Exit Sub
        End If
 End Sub
 
You do not need to check manually at formOpen. If you use the NoData event it will be much easier


Private Sub Report_NoDate(Cancel As Integer)
MsgBox "Your entered data is invalid or result not found", , "Sorry!"
Cancel = true
End Sub
 
meenctg:

Where are the search controls and button? On the form that opens the report or on the report itself?
 
You do not need to check manually at formOpen. If you use the NoData event it will be much easier


Private Sub Report_NoDate(Cancel As Integer)
MsgBox "Your entered data is invalid or result not found", , "Sorry!"
Cancel = true
End Sub

I am getting the result Your entered data is invalid or result not found but here another message shows " The OpenReport action was canceled "

I was created this report base on two fields. That mean when i run the report i have to input two value.
 

Users who are viewing this thread

Back
Top Bottom