Aaron's incorrect: there's no Path property for the CurrentDb object.
CurrentDb.Name will give you the full path to the file. You can retrieve
only the path using:
Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))
Alternatively, Access 2000 and newer have Application.CurrentProject.Path
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
<(E-Mail Removed)> wrote in message
news:33ae0772-6eb4-4ad5-afba-(E-Mail Removed)...
> Hi,
>
> I am trying to find the path that the my database is in using VB.
> example
>
> dim dbPath as string
> dbPath = currentDatabase.path
>
> I know this is incorrect code and I don't know how to write the
> correct code. To do the same thing in Excel is as follows:
>
> dbPath = ThisWorkbook.Path
>
> Does anyone know how to do this?? thanks.