File Name and Path

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

When in an Access Form I would like a field to default to
the name of the Access Database and the path.
The CurDir does not work because sometimes the file is
openned from Explore and the CurDir shows as
C:\..\MyDocuments. However if it is openned from the
program then CurDir works. However, then if it is
minimized and the user moves around in other programs and
comes back to it the default is wrong again.
Is there a command that gives you the Filename and path of
the open Access file?

I have the same problem in Excel I use
MyPath = CurDir & "\" & ActiveWorkbook.Name
but if the user goes to other programs and files and back
they get the wrong path.

Thanks for any help.
 
When in an Access Form I would like a field to default to
the name of the Access Database and the path.
The CurDir does not work because sometimes the file is
openned from Explore and the CurDir shows as
C:\..\MyDocuments. However if it is openned from the
program then CurDir works. However, then if it is
minimized and the user moves around in other programs and
comes back to it the default is wrong again.
Is there a command that gives you the Filename and path of
the open Access file?

I have the same problem in Excel I use
MyPath = CurDir & "\" & ActiveWorkbook.Name
but if the user goes to other programs and files and back
they get the wrong path.

Thanks for any help.

currentdb.name
currentproject.path
 
Back
Top