• Checking for compiled version in VBA

    Author
    Topic
    #466126

    Sorry for what may seem as silly, but I can’t find anything by searching here. Probably using the wrong syntax.

    Is there a way to determine in VBA is the program executing is an mde vs. mdb?

    Thanks in advance for your assistance.

    Ken

    Viewing 1 reply thread
    Author
    Replies
    • #1206673

      CurrentProject.Name

      Will report back the name of the database.

      You can get it from this.
      Assuming you are running this from a Module inside the database.
      And that was your question.

    • #1206736

      Thanks!  Using your suggestion I came up with:

      Dim strPath As String

      strPath = Application.CurrentDb.Name
      If UCase(Right(strPath, 3)) = “MDB” Then
           MsgBox “This is an MDB.”
           Else
           If UCase(Right(strPath, 3)) = “MDE” Then 
               MsgBox “This is an MDE.”
           Else
                MsgBox “Unknown Database Format”
           End If
      End If

      And it accomplished my goal.

      Thanks again!

      Ken

    Viewing 1 reply thread
    Reply To: Checking for compiled version in VBA

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: