Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:46:40+00:00 2026-06-09T01:46:40+00:00

ACCDB file using VBA. I am looking for a specific folder in the path

  • 0

ACCDB file using VBA. I am looking for a specific folder in the path of the database location. It will always be 3 deep from the file, but the depth in the drive is variable. I grabbed the project path, split it, but can’t find a function to reverse it. Is there a built-in function or do you have to code it yourself. I have looked around and surprisingly can’t find the solution anywhere.

    Dim pth As String
    Dim apth As String
    pth = Application.CurrentProject.Path
    apth = Split(pth, "\")
    'Reverse array here
    apth = apth(2) 'Grab second index
    MsgBox (apth) 'confirm folder
    Call search_Project(apth)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:46:42+00:00Added an answer on June 9, 2026 at 1:46 am

    there are a couple issues with the code like you can declare a string and then try and use it as an array. Below is the modified using the length of the array and subtracting 3 to get the position you want. I also added a check to ensure the length of the array is atleast 3 elements. Removed the as String for apth as you want to use it as an array.

    Dim pth As String
    Dim apth
    pth = Application.CurrentProject.Path
    apth = Split(pth, "\")
    'Reverse array here
    If UBound(apth) >= 3 Then
    apth = apth(UBound(apth) - 3)
    End If
    'Grab second index
    MsgBox (apth) 'confirm folder
    Call search_Project(apth)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get the folder path from the file who is running the
Using Access Database (*.mdb or *.accdb) is very simple. But I wonder about performance
Using C, I am trying to create an Access 2007 database file using ODBC
I recently updated my database from .mdb (MS Access 2003) to .accdb (MS Access
I need to compact and repair an Access 2007 .accdb database file. I know
I'm having an issue with writing back to my Access Database (.accdb) through using
I am trying to make a website in C# and .accdb database using Visual
I'm moving tables from an .accdb file to MySQL. In Access 2010, I could
When I try to get the response from a php file using Jquery ajax,
I am using pyodbc to access an access (accdb) file. I want to add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.