Two messages at no data in a report

L

Leif Thorsen

I have a form with a Click-Buttom for opening a report.
In the design mode of the report I have used "At no data" and there included
a Messega Box saying "Sorry-there is no data in this report".

When having no data i the report and clicking on my buttom in the form I
will hav 2 messages.

The first one is from my message box "Sorry ...."

The second one is from the error handling for the buttom saying "Instructio
Open report cancelled" (Translated from Swedish "Instruktionen PoenReport
avbröts).

A part of the error code for the buttom is
Err_Kommandoknapp6_Click:
MsgBox Err.Description
Resume Exit_Kommandoknapp6_Click

I have noted that by deleting the row "MsgBox Err.Description" in the error
code above I only get one error message i.e. the one I myself have invented
"Sorry ...." which is the only message I want to have.

Do I do the wright thing or is there a better way of doing it ???

Thank You in advance for an answer
 
B

Brendan Reynolds

Leif Thorsen said:
I have a form with a Click-Buttom for opening a report.
In the design mode of the report I have used "At no data" and there
included
a Messega Box saying "Sorry-there is no data in this report".

When having no data i the report and clicking on my buttom in the form I
will hav 2 messages.

The first one is from my message box "Sorry ...."

The second one is from the error handling for the buttom saying
"Instructio
Open report cancelled" (Translated from Swedish "Instruktionen PoenReport
avbröts).

A part of the error code for the buttom is
Err_Kommandoknapp6_Click:
MsgBox Err.Description
Resume Exit_Kommandoknapp6_Click

I have noted that by deleting the row "MsgBox Err.Description" in the
error
code above I only get one error message i.e. the one I myself have
invented
"Sorry ...." which is the only message I want to have.

Do I do the wright thing or is there a better way of doing it ???

Thank You in advance for an answer


To ignore specific errors or take different actions for specific errors,
check the error number. Here's an example ...

ErrorHandler:
If Err.Number <> 2501 Then '2501 = action was cancelled
MsgBox "Error " & Err.Number & ": " & Err.Description
End If
Resume ExitProcedure
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top