How to refer to Current Database Name?

G

GaryS

I want to put the filename of the current database (i.e.,
*.mdb) into a label on the opening switchboard, but I
don't know how to reference it.

Thanks.
 
V

Van T. Dinh

For A2K & AXP:

CurrentProject.Name

For A97 (also works in A2K and AXP):

Dir(CurrentDb.Name)

Both will show the "mdb" extension. If you don't want to show the
extension, use InStr and Left to manipulate either of the above statement.
 
Top