[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 582
  • Last Modified:

How to verify Access filename in vba?

I want to run a set of code that will say something like;

if access.application.name = "FAIDatabase" then
...

So I'm basically testing to see what the file name of the access program is where the code is being executed.

Any Ideas?

Thanks!
0
SeyerIT
Asked:
SeyerIT
  • 3
  • 2
3 Solutions
 
Michael VasilevskySolutions ArchitectCommented:
CurrentDB.Name will give the name of the current .mdb file
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
CurentProject.Name
returns (example)
aaEE2.mdb
0
 
SeyerITAuthor Commented:
Ok.. let me give these a try.. I assume this will work the same for .accdb files as well?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Yes
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Also have:

CurrentProject.Path
C:\Documents and Settings\Administrator\Desktop\EE

CurrentProject.FullName
C:\Documents and Settings\Administrator\Desktop\EE\aaEE2.mdb
0
 
SeyerITAuthor Commented:
Thanks that did the trick!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now