Which is more efficient?

  • Thread starter Thread starter ThriftyFinanceGirl
  • Start date Start date
T

ThriftyFinanceGirl

Which is faster?

Calculating an expression in a control on a report or
Creating a function and calling the function inside the control?

Does it make any difference?
 
Where possible, you probably want to calculate the expression rather than
refer it to a function.

The reason for this is that each function you call from a form or report
needs to be public... your entire project will be able to see it, and that's
going to take up more overhead.

I believe calculated expressions are handled a bit more navitely as well
(e.i. access has everything all in place ready to go when it needs it, rather
than having to locate your public function, pass the values, etc.)

This probably depends on the information being processed, but that's my
general take on it (FWIW, I'm no guru...)

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Jack Leach said:
Where possible, you probably want to calculate the expression rather than
refer it to a function.

The reason for this is that each function you call from a form or report
needs to be public... your entire project will be able to see it, and
that's
going to take up more overhead.

Interestingly, this turns out not to be true. In a form, at least -- I
haven't tried this with a report -- you can create a private function in the
form's module and call it from the controlsource of a control on the form.
Yet the function really is private to the form, and other modules can't see
it.
 
Thanks Guys, this is all great information and helps me now and in the future!
 
Back
Top