path to database

yeh yeh yeh, him asking silly questions again.

is it possible to get access to ‘know where it is’? as in the database I’m working on, I have it in two locations, I have my dirty copy and a copy thats there for people to look at so they can see my progress ( I export data from one to another ) I use pictures in one of the forms and the pictures location is relative to the database, I can’t seem to get them to hook up unless I use a hard coded file path which I would rather not do.

I have this but it dosent work

On Error GoTo bugger
    Me.Photo.Picture = "\Photo\" & Me.Service_No.Value & ".jpg"
exitsub:
    Exit Sub
bugger:
    Me.Photo.Picture = "\Photo\No_Image.jpg"

I get errors saying it can’t find the image

anyone?

to answer my own question

Getting the location to the current database using Access 2000/2002/2003…

'returns the database file name
CurrentProject.Name

'returns the database path
CurrentProject.Path

'returns the database path and the file name
CurrentProject.FullName

Getting the location to the current database using Access 97…

'returns the database file name
Dir(CurrentDb.Name)

'returns the database path
Left(CurrentDb.Name,Len(CurrentDb.Name)-Len(Dir(CurrentDb.Name)))

'returns the database path and the file name
CurrentDb.Name

'returns the directory that Access [msaccess.exe] is installed in
(SysCmd(acSysCmdAccessDir))