How Do I Avoid this 4227 error?

  • Thread starter Thread starter doyle60
  • Start date Start date
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
 
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.
 
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
 
Back
Top