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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Message Box Repeats From Header 1

Status
Not open for further replies.

gimmyd

Technical User
Apr 12, 2002
36
US
I have three subreport.HasData checks going on in the OnFormat event of the Report Header. They display fine but when I go to print they want display again. Have tried checking FormatCount but it remains at 1 even after it seemingly revisits header before printing. I have set my own variable to increment after ReportHeader Format event but somehow after I start print it does not go back to ReportHeader Format before displaying the message boxes again. Any thoughts?
 
I'm having a hard time following what your problem is. It sounds like you have users entering data into an inputbox or someting else when the on format event runs and you don't want it to do so when you print it.

The On format when the report is previewed and again when it is printed... Think of it as opening the report twice, but not exactly.

You could enter the user input data into a form and get the data from there, that way it would be checking for the same info someplace it already is.
 
Sorry for cloudy description. I have three message boxes that check for data in two subreports and in the main report. They are activated by a check the .HasData property. First message from subreport "No records over 90 days old", second message "No records over 60 days old." Finally, it checks the main report for the presence of records over 30 days old. After all checks have been made and the user is notified of each the report previews. This works fine. Then when I go to print the report the messages display again. There is no user input other than OK.
 
Your problem is still the same. The report still starts formatting over when it prints...

You could run code somewhere else. Perhaps the on click event of the button that opens the report?

Here's a thought, Initialize a global variable to 0 on the report's open event. Increment it each time the format event runs, and only perform the hasdata test if the variable is 0.
 
Thanks, that was the key. The global once again saves the day. Appreciate your time and thought.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top