?
Solved

how to check if a drive is availeble

Posted on 2003-02-19
4
Medium Priority
?
153 Views
Last Modified: 2010-04-07
my program uses the disk drive. How can I check that there is an disk in the drive so that I don't run on an error.
0
Comment
Question by:jpwiedenhoff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 8

Expert Comment

by:List244
ID: 7984912
Just add an error check Something like that

on error goto ErrorS

Private Sub NAME()
YOURCODE
HERE
exit sub
ErrorS:
Msgbox "No disk is in the drive"
End Sub
0
 
LVL 2

Expert Comment

by:JoaTex
ID: 7985034
Hi
Private Sub Form_Click()
   On Error GoTo ErrorHandler
   ChDir "a:\"
   Exit Sub
ErrorHandler:
   MsgBox "There's no Disk in Drive"
End Sub
0
 
LVL 8

Expert Comment

by:List244
ID: 7990279
yeah little mistake there 'on error' goes in the sub, sorry about that
0
 
LVL 8

Accepted Solution

by:
List244 earned 80 total points
ID: 7990421
'Should like like this, sorry.

Private Sub NAME()
on error goto ErrorS
'YOURCODE
'HERE
exit sub
ErrorS:
Msgbox "No disk is in drive"
End Sub
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question