Determine File Location

A

alex

Hi,

Is it possible (in VBA) to check and see where an Access file is being
opened/accessed from?

For example:
If mdb/mde file attempting to be opened resides in C:\db then
'do something
else
'do something else
end if

Thanks,
alex
 
D

Dirk Goldgar

alex said:
Hi,

Is it possible (in VBA) to check and see where an Access file is being
opened/accessed from?

For example:
If mdb/mde file attempting to be opened resides in C:\db then
'do something
else
'do something else
end if

Thanks,
alex


CurrentProject.Path returns the folder path where the current database
resides.

CurrentProject.Name returns the name of the current database file.

CurrentProject.FullName returns the folder path and name of the current
database file.

CurrentDb.Name also returns the folder path and name of the current database
file, but doesn't work in an ADP (Access Data Project).
 
A

alex

CurrentProject.Path returns the folder path where the current database
resides.

CurrentProject.Name returns the name of the current database file.

CurrentProject.FullName returns the folder path and name of the current
database file.

CurrentDb.Name also returns the folder path and name of the current database
file, but doesn't work in an ADP (Access Data Project).

--
Dirk Goldgar, MS Access MVP
Access tips:www.datagnostics.com/tips.html

(please reply to the newsgroup)

Worked perfectly Dirk; many thanks!
alex
 

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