Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop opening report on certain condition?

Status
Not open for further replies.

padinka

Programmer
Jul 17, 2000
128
US
I have a report that checks for a certain value in the data via vb. If the value is there, I wish to stop the report from opening and prompt the user to fix the problem. How do I do stop a report from opening.
Trisha
padinka@yahoo.com
 
Use the OnOpen event for the report.

In the OnOpen Event check for your condition using an if statement.

If {condition to cancel is true} then
DoCmd.close acReport,Me.Name
Exit Sub
endif

I think this will take care of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top