J
Junior
Opening a report from a form -
When the report is closed i want to return to the form-
If the report has data the report close event will do this -
DoCmd.OpenForm "frmReports", acNormal, "", "", , acNormal
HOWEVER- if there is NO data - i also want the focus to return to the form
using the no data event - How do i return to the form if no data?
Private Sub Report_NoData(Cancel As Integer)
'(error handling ommitted)
MsgBox "There is no data to report." _
, vbOKOnly + vbInformation, "No Data Found"
Cancel = True
End Sub
When the report is closed i want to return to the form-
If the report has data the report close event will do this -
DoCmd.OpenForm "frmReports", acNormal, "", "", , acNormal
HOWEVER- if there is NO data - i also want the focus to return to the form
using the no data event - How do i return to the form if no data?
Private Sub Report_NoData(Cancel As Integer)
'(error handling ommitted)
MsgBox "There is no data to report." _
, vbOKOnly + vbInformation, "No Data Found"
Cancel = True
End Sub