Function in Report is repeating itself?

thrainpa

Registered User.
Local time
Today, 21:37
Joined
Dec 1, 2011
Messages
29
Hi, I call some functions from a report but this report seems to have an issue; It runs all functions in correct order, twice.

Is there anyone who can tell me why it is doing this and how i can prevent it?

The functions are public and are being called from a common module.
 
Last edited:
How are you able to decipher this?

In what event is the function being called?
 
How are you able to decipher this?
In what event is the function being called?

Decipher? I'm sorry I don't get what you mean, if you meant how did I figure that it was doing the whole thing twice then basically I run a Debug.Print at the start of the functions to see how many times they run.

The functions are called in the report itself in their fields. I know that report goes through a recordset and do the executions each time; But I noticed, that it runs through the whole thing again, it executes it once for each field and returns it's values correctly, but then goes though the whole process a second time unnecessarily, slowing my users down, and I know I don't call them twice in the code.
 
You mean you are calling the function in the Control Source of the control?
 
You mean you are calling the function in the Control Source of the control?

Yes, sorry I didn't clarify; And here is where I find out that is the worst thing to do hehe. :P
 
Have you implemented page numbering in your report, specifically the total number of pages? If you call "pages" then that forces the report to run twice - the first run is to find out the value of "pages" so that it can be used in the second run. The first run is invisible to the user but any functions would run twice.

Chris
 
Have you implemented page numbering in your report, specifically the total number of pages? If you call "pages" then that forces the report to run twice - the first run is to find out the value of "pages" so that it can be used in the second run. The first run is invisible to the user but any functions would run twice.
Chris

Thank you, but no, I am not aware I have used any page feature, this report was never meant to be printed.
 
Can you post a copy of your database? Or at least the report and some dummy data.
 

Users who are viewing this thread

Back
Top Bottom