Computer Learning Zone CLZ Access Excel Word Windows

We are all connected; To each other, biologically. To the earth, chemically. To the rest of the universe atomically.

-Neil DeGrasse Tyson
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Imaging Seminar    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 

Ray McCain 
    
16 years ago
Due to the use of multiple folders to set up the albums needed for this photo directory, I need to retreive the entire path all the way to FileFolder which ends with "Images\".  Since the backslash is in all likelihood not the last one in the path name, I need to know how to rewrite the mid or instr functions to accomidate this.



Reply from Richard Rost:

You can start from the end of the string containing the path/filename to isolate just the pathname. I would start a loop that looks for that last backslash. Let's say you have:

S = "C:\Users\Richard\Images\something.jpg"

X = len(S)
While X > 0 and mid(S,X,1)<>"\"
   X = X - 1
Wend

Now you have the position of the last "\" in the string. At this point you can cut off the filename, which you can do with:

S = left(S,X)

Now you have just:

S = "C:\Users\Richard\Images\"

If you want to get what's BEFORE the Images\ folder, you can now just chop that off:

S = Left(S,Len(S)-7)

Since you know that "Images\" is 7 characters. Now you're left with:

S = "C:\Users\Richard\"

Hopefully this is what you're trying to find. Now, I haven't fully tested this (it's off the top of my head) and I didn't add any error handling (what if there are no \ in the string?) but it should get you started.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Imaging Seminar.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 7:51:21 PM. PLT: 1s