Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Default Folder for Browse
Colin Smyth 
      
4 years ago
I use the browse code from Richard to load a photo into my database. Is there a way to tell it to go to a default folder each time or is there a way in the properties of the button I have set up to tell it to open at a default folder where the photos are contained?
Alex Hedley  @Reply  
           
4 years ago
Colin Smyth OP  @Reply  
      
4 years ago
Hi Alex. I use the pick a file with FileDialog. My photos are not stored on my C drive. So when I go to pick a file, windows explorer takes me to the documents folder on my C drive. What I am asking, is there a way so that I can set up a default, so that when I click on the browse button to run the above programme, it can take me to the right folder on my E drive where the photos are stored. Thank you.
Scott Axton  @Reply  
        
4 years ago
Use:

To pick a file, starting in the folder C:\MyFiles:

    MyTextFieldHoldingTheFileName = PickFile("C:\MyFiles\")
Colin Smyth OP  @Reply  
      
4 years ago
Thank you Scott. I have tried putting this line in different places but it keeps bringing up an error. So does it go it go in the initial Filedialogue section? It kept telling me there were errors. Any assistance would be great. Thank you
Scott Axton  @Reply  
        
4 years ago
Are you not using the PickFile() function Alex pointed you to?  if not, what code are you using to ask for the file name?
Kevin Robertson  @Reply  
          
4 years ago
Colin,

You need to put the code in the Click Event of a Button.
You are a beginner so I would watch Intro To VBA if you haven't already.
Colin Smyth OP  @Reply  
      
4 years ago
Hi Scott. Yes I am using the Pickfile() function and it works fine. Yes Kevin you are correct about being a bit of a beginner especially with VBA. However, I do have the code in the click event of the button. What I am not sure is where I put the statement that Scott sent in relation to the rest of code eg is it placed immediately before Photo6 = Pickfile() or somewhere else? I have previously watched the intro to VBA but when you are not using it all the time, things slip out of the memory. Thank you all for your advice and help
Kevin Robertson  @Reply  
          
4 years ago
Did you use the code in the Images Extended Cut?
If so, enter the following line BEFORE FO.Show replacing what is in the quotes with the full path of your default folder.

FO.InitialFilename = "C:\YourPath\"
Colin Smyth OP  @Reply  
      
4 years ago
Hi Kevin. Yes I did use the code as you mentioned. I have now added the line where you suggested and it works perfectly. Thank you Kevin for helping to deal with my lack of expertise - I really appreciate everyone's advice and help. Many thanks

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

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: 5/6/2026 11:34:22 PM. PLT: 0s