File Name and Path

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.
 
A

Andi Mayer..

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top