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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
How to Check if a Drive is Available
Garry Frank 
     
15 months ago
I am trying to create a button that backs up all my databases with one click.  I have three databases I need to back up on a regular basis, and I would like to back them up with one button.  I normally back my files up on a flash drive (E:) but sometimes forget to insert the drive.  If I press the button without the drive inserted, it doesn't back up the file and doesn't inform me of my mistake.  How do I check to see if the drive is inserted, and send a message that tells me the backup didn't work because of the error?

Note:  I think backing up to the C: drive is stupid, because if the hard drive crashes, you lose the original AND the backup.
Kevin Robertson  @Reply  
           
15 months ago
Give this a go (see screenshot) and let me know if it works for you.
Kevin Robertson  @Reply  
           
15 months ago

Alex Hedley  @Reply  
           
15 months ago
DriveExists
https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/driveexists-method

DetailsSet fso = CreateObject("Scripting.FileSystemObject")
Debug.Print fso.DriveExists("C") 'Result: True
Debug.Print fso.DriveExists("E") 'Result: False

https://analystcave.com/vba-filesystemobject-fso-in-excel/vba-driveexists/
Garry Frank OP  @Reply  
     
15 months ago
Okay, I couldn't get Kevin's method to work (I was still looking for a typo), when I figured out that all I needed was a reminder MsgBox asking me if I had put the flash drive in.  It works.  I do appreciate your response though and will go ahead and test both of these.  Thanks for your input.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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/8/2026 9:31:50 PM. PLT: 0s