VBa Choosing the wrong directory!

  • Thread starter Thread starter Nick Ward
  • Start date Start date
N

Nick Ward

Hi
I have a db located at C:\BA
when I place the following in the sub:
Dim m_strDIR
m_strDIR = Application.CurrentProject.Path & "\templates\" it works fine
debug.print m_strDIR outputted the correct C:\BA\Templates\
However when I put the same line in a Function and call it in the routine
it gives me
C:\Documents and Settings\steve\My Documents\BA\Templates\!
I tried changing the default directory to C:\BA to see if that was the
problem...
Is it me?

tia

nick
 
I have a db located at C:\BA
when I place the following in the sub:
Dim m_strDIR
m_strDIR = Application.CurrentProject.Path & "\templates\" it works fine
debug.print m_strDIR outputted the correct C:\BA\Templates\
However when I put the same line in a Function and call it in the routine
it gives me
C:\Documents and Settings\steve\My Documents\BA\Templates\!
I tried changing the default directory to C:\BA to see if that was the
problem...
Is it me?

The value of "CurrentProject.Path" won't change as a result of referencing it
from a function or other procedure. Post the function, and how it is being
called, and I'm sure that someone will see what is happening.
 
Back
Top