Re: Help! "Out of Memory" errors with Appointments created from A



"Chris O''''Neill" <ChrisONeill@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:323A8CFC-8F51-4B0F-84BE-82CD82177B38@xxxxxxxxxxxxxxxx
No need to hide under a rock. I really do appreciate your suggestions as
it
helps me learn.

Normally, I place all Dim's at the beginning of a subroutine, and I've
since
done that here too, but at that point I had the Dim's inside the IF/Then
statements so that they wouldn't occur unless the appointment was going to
be
created.
<snip>

You can't have conditional Dim statements in any flavour of VB or VBA. Even
though you place them inside If Then blocks, the compiler reads them and
allocates memory for the variables in it's first pass through the code, then
it compiles the code in another pass. So just where you place them inside a
procedure is irrelevant. That's why most developers place them at the start
of the procedure. That way they're conveniently grouped together, and you
might as well anyway (for the above reason).

HTH


.