This sounded really neat so I just tried it. When I run the report I get the "Me.pages" text instead of the page count. Am I missing the point?
Thanks!
"This report is " & Me.Pages & " long."
I tried both of these in a macro that is called from the report footer format event. The only difference is the quotes or lack of them in the message box.
That's the first thing I tried. I get a message "Change Log can't find the macro "msgBox"ThisReport is"& Me."
The macro or its group doesn't exist or is new but hasnto been saved.
This mention to macros is why I then tried use a macro.
(And why won't access let you highlight and copy an error message. I had to copy that down with a PENCIL.)
Hum...It sounds like maybe you put the code on the line next to the Report Footer Event and therefore the report is looking for a macro by that name. Here's what you do. Open your report in Design View. Open the properties window for the Report Footer. Click on the line next to the Format Event and you will see a dropdown arrow and an elipsis(the button with three dots ... on it). Click on that button. Then you will get a window that has three buttons in it. Click the Code Builder button and this will open the Format Event for the Report Footer. In between the Private Sub and End Sub lines, insert the MsgBox line that I posted above. Then when you close that window, make sure that the line next to the Format event has the words [Event Procedure] showing on it. That should take care of it.
Thanks, that helped a lot. I do get a message box now. It says 0 pages (for a 29 page report), but am grateful for progress! I've tried moving it to a couple different report segments. Sometimes it says 0 pages until I click the page navigation button, then updates to the correct number of pages. I'll keep trying things.
Sorry, put it in the PageFooter Print event. Follow the same procedure as before to get to the event procedure. Make sure you take it out of the Report Footer event also. This will give you what you want.
I hadn't gotten around to trying there yet and, Yippee, it works! That is an interesting exercise to see how the same thing works differently when it is called from different places.
Thanks bunches!
I was a little surprised that it worked there and not in the Report Footer. I would have thought the results would have been 0 for the Page and a number for the Report event but it works and that's good.
Thanks, Paul!
I wonder if the original poster of this question (mobile2)is way ahead of me on this topic. Haven't heard from him/her through all of this. Anyway I have learned a lot from this question and all others in the forum. Thank you to all participants for the very informative posts.
I am a new user to tek-tips but was really surprised to see the response to a thread I started. This is a really good way of sharing knowledge and I am really impressed with all the expert advice people have given me. I will try and make my responses a bit more interesting in future and stop taking things too seriously.
Welcome back mobile2. I would suggest you start by reading some of the FAQ's that help instruct you in which forums will best get you the answers you need and just the general procedures around here and then have fun. That's what we're here for.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.