What type of file am I?

A

alex

Using Access ‘03

Is it possible for an Access file to know what type of file it is?

E.g.,

If FileExtension = .mde then
‘Run some code
Else
‘nothing
End IF

Thanks,
alex
 
R

Rick Brandt

Using Access ‘03

Is it possible for an Access file to know what type of file it is?

E.g.,

If FileExtension = .mde then
‘Run some code
Else
‘nothing
End IF

Thanks,
alex


If Right(CurrentDB.Name,3) = "MDE" Then...
 
D

David W. Fenton

m:
Using Access '03

Is it possible for an Access file to know what type of file it is?

E.g.,

If FileExtension = .mde then
'Run some code
Else
'nothing
End IF

Not a good idea, as a file can be any arbitrary file extension.

What you want is:

CurrentProject.ProjectType

Also, for MDBs,

CurrentProject.FileFormat

can help you distinguish between the various versions of the MDB
file format.

I don't have A2007 installed to test, but I assume constants have
been added to the enums for these in order to cover the new file
format and its variants.
 
Top