Warrio said:
Thanks for the advice ; )
but I thought that Access reserves a place in the memory only when you
intialize the variable with a data not on the Dim statment?!?
No, not quite.
With a string, or variant, then yes..the storage is not allocated until
runtime, because you don't know the size of the variable.
However, with fixed length strings, integers, long, currency etc, they
actually default to a value of zero, and the storage is allocated at
runtime..even if you DO NOT set their values....
I am surprised that the "analyzer" suggests to use option explicit. It does
mean that some variable defences will be pre-made, and thus some speed up
might occur, but you not going to measure it by much. I also suspect that
suggestion remains from 14 years ago, and back then..it would make a
diference.
The problem is that access today can easily run 80 million instructions in a
second. So, even if saved a million instructions that still only 1/80th of a
second. And, when is the last time you ran 80 million instructions? those
old comptuers ran at 8mhz, and today were at 3 ghz.
ms-access has not bee processing bound for about 7+ years now. So, if you
increase the processing speed of your computer, you will not see a
improvement in the speed of your code. The speed of memory, disk drive, and
of course in multi-user with a network are all factors FAR more important
then optimizing some processing. Where optimizing today pays off is to
reduce i/o.....not processing....
While access can execute a command to retrieve a record in a instant, you
then have to wait for the operation system, memory, and the disk drive to
get that data. We are i/o bound for the most part...