How Do I Avoid this 4227 error?

D

doyle60

I get the run-time error '2427' error with the message "You entered
an
expression that has no value" when I run a certain report. The query
is already difficult enough. I'd rather just interrupt the message
and insert my own message stating "You did not hit the Set Comparison
button" and have the report close down completely. The error is due
to something in a subreport.

Someone gave me code to do something like this before but I have no
idea where in my database it is. It's pretty big at this time.


Thanks,


Matt
 
A

akphidelt

In the code you can catch the error like this

On Error GoTo Err_NotClicked

Then at the bottom of the code write

Err_NotClicked:
MsgBox "Enter your message here", vbCritical

Make sure you put an Exit Sub before the Err_NotClicked:
Otherwise the message will show up everytime the button is clicked regardless.
 
D

doyle60

Thanks. I followed your directions and the error message does not
come up. But the report still opens, showing blanks and "errors".

How do I get the report not to pop up at all?

The code is in the On Print of the detail section.

Thanks again,

Matt
 

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