Hi
I am getting an error " Run-time error 2585 This action cant be carried out while processing a form or report event"
I have a form where i run a report when i press the command button. i have written code when there is no data in the report. I get the error at on DoCmd.Close acReport line asking me to debug it. Earlier I didnt get this error now i am getting this run time error.
Private Sub Report_Analyst1_NoData(Cancel As Integer)
MsgBox "There are no records for this Sample Number!"
DoCmd.Close acReport
Cancel = True
End Sub
Private Sub Report_Page()
Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), , B
End Sub
Please let me know what could be the problem.
I am getting an error " Run-time error 2585 This action cant be carried out while processing a form or report event"
I have a form where i run a report when i press the command button. i have written code when there is no data in the report. I get the error at on DoCmd.Close acReport line asking me to debug it. Earlier I didnt get this error now i am getting this run time error.
Private Sub Report_Analyst1_NoData(Cancel As Integer)
MsgBox "There are no records for this Sample Number!"
DoCmd.Close acReport
Cancel = True
End Sub
Private Sub Report_Page()
Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), , B
End Sub
Please let me know what could be the problem.