Hi all,
Is there any way to close a report when there is no data present??
I currently have a report with this code (and only this atm)
but this produces a run-time '2585:This action can't be carried out while processing a form or report event.'
I tried adding a 'DoEvents' before DoCmd.Close but that didn't work.
All i need is for the report to throw out an err msg and close itself, not throw out an error and open a blank report...
all help appriciated thx.
if at first you don't succeed, get a 10lb lump hammer
Is there any way to close a report when there is no data present??
I currently have a report with this code (and only this atm)
Code:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data was found, aborting...", vbCritical
DoCmd.Close acReport, Me.Name, acSaveNo
End Sub
but this produces a run-time '2585:This action can't be carried out while processing a form or report event.'
I tried adding a 'DoEvents' before DoCmd.Close but that didn't work.
All i need is for the report to throw out an err msg and close itself, not throw out an error and open a blank report...
all help appriciated thx.
if at first you don't succeed, get a 10lb lump hammer