Solved

Access Report Events

Posted on 2014-10-29
4
206 Views
Last Modified: 2014-10-31
I am using the report_open event in access and I have code in it to change the value of a text box for each different item that loads. It fires the correct amount of times, but it fires too soon. Is there a way to wait for the elements on the page to load and then run the function? Right now all my data is shifted down one item. The level and title are the items that are wrong. The rest of the data is correct. The level and title for the first item are blank, but the level and title for the second item should be in the first items place and the third item in the second. It is also not running the last items level and title. This is the screenshot of the report.
0
Comment
Question by:rcimasi
4 Comments
 
LVL 30

Expert Comment

by:hnasr
ID: 40412663
Quick reply, try the load event.

If more work is needed, upload a sample report demonstrating the issue.
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40412950
Not sure I'm understanding the setup, but it would either be the OnLoad as hnasr suggested or more normally, the OnFormat events of each of the bands (report header, page header, group header, detail, group footer, page footer, and report footer).

 OnPage fires after the page is full rendered, but your limited in what you can do at that point.


Jim.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40413988
Please reply to the above two experts first...

I have code in it to change the value of a text box for each different item that loads.
Is there a way to wait for the elements on the page to load and then run the function?
Can you clearly explain what that means?, ...and provide an explanation or example?
what is this function? What does it change and why?

For example, If your report is based on a table or query, ...then what needs to "change" for each record or group?...
...In other words, perhaps there is a better way to accomplish this...
(Perhaps adding the function to be called in a field in the reports recordsource/query, ...instead of trying to do this with report events.

JeffCoachman
0
 

Author Closing Comment

by:rcimasi
ID: 40416067
Placing my code in the OnFormat event worked.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
A short article about problems I had with the new location API and permissions in Marshmallow
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question