Finding Path

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to show the "full" path of the current database in a text box on
a form. Is there any way to do this? Any help would be appreciated.
 
try this
On the load event of the form, write the code

Me.TextBoxName = CurrentProject.Path
 
Hi, Duane
I'm not sure it will work in the control source of the field, this is why I
recomnded puting the code in the on open event.

--
I hope that helped
Good luck


Duane Hookom said:
Set the control source to:
=Currentdb.Name
 
Just try it.
=CurrentProject.Path returns the path without the file name
=Currentdb.Name returns the path and file

--
Duane Hookom
MS Access MVP


Ofer said:
Hi, Duane
I'm not sure it will work in the control source of the field, this is why
I
recomnded puting the code in the on open event.
 
I do have reference to DAO, but plaese don't bother yourself about it, I'm
sure you have enough on your mind
 
Ofer,

Then perhaps you need to re-register the DAO object library. All of the
following should work as the control source for a textbox on a form, when
using Access 2000 or later:

Returns the full path (path + filename):
=Currentproject.FullName

Returns the path only
=currentproject.path


Returns the full path (path + filename). This works in earlier versions of
Access as well, but requires a reference to the DAO library:
=Currentdb.Name


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

I do have reference to DAO, but plaese don't bother yourself about it, I'm
sure you have enough on your mind
 
Back
Top