Sometimes it is useful when writing to a floppy or CD to verify that the media is inserted before moving along.
Otherwise, Access will give a nasty looking message.
To verify that a floppy has been inserted into the A: drive use the following code:
Dim fs, d
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive("A:")
If d.IsReady Then
'Begin code execution here.
Else
MsgBox "A: drive is empty. Please insert disk."
End If
To verify that the CD drive is ready simply replace A: in the above code with the corresponding drive letter (most cases D.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.