Calling a result from another sub procedure

L

legere864

I have a report that generates a result in a private sub. I would like to
utilize that result in another report's private sub. How do I call just the
result from the other report?

Thanks in advance.
 
G

George Nicholson

declare a Public variable (in a general module)

When the result is 1st generated, store the value in the variable.

When the 2nd report runs, have it read the "most recently generated" value.
Of course, if the 1st report hasn't been run, the 2nd report will be reading
garbage.

Otherwise, make the function public and place it in a general module and
call it from both reports.
That way a "good" value would be available to both reports regardless of the
order in which they are run.

HTH,
 
Top