Check A-Drive

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am exporting an excel file created in Access to the A-drive. What I would
like to have Access do is check the A-drive first before commiting the
following line of code:

FileCopy cstrTemplate, cstrFileDest 'Copy the excel Template file
structure to the new excel file RJD and Todays date.

Basicly I would like a message that goes something like "You must first
insert a floppy disk in the A-drive, then press OK" This message of course
must have an OK button.

How can I make this work?
 
Don, just go ahead and do the copy operation, and rely on error handling to
recover if it doesn't work.

There are just too many things that could go wrong with a copy operation,
e.g. faulty disk, write-protected disk (hardware or software), there is no
floppy disk (could happen after an upgrade, if the drive goes bad, or if it
is reassigned in hardware or software), disk full (or not enough space,
with/without whether existing file with the same name will be overwritten),
disk already in use, permissions, not to mention all the other kinds of
things that can go wrong when writing a file (bad file name, invalid path,
bad sectors, can't overwrite read-only file, and so on.)

If necessary, you can start with a MsgBox letting the user know the
operation is about to happen, e.g.:
If MsgBox("About to create A: file", vbOkCancel) = vbOk Then
Docmd.TransferSpreadsheet ...
End If
 
Thank You,

Dennis


Allen Browne said:
Don, just go ahead and do the copy operation, and rely on error handling to
recover if it doesn't work.

There are just too many things that could go wrong with a copy operation,
e.g. faulty disk, write-protected disk (hardware or software), there is no
floppy disk (could happen after an upgrade, if the drive goes bad, or if it
is reassigned in hardware or software), disk full (or not enough space,
with/without whether existing file with the same name will be overwritten),
disk already in use, permissions, not to mention all the other kinds of
things that can go wrong when writing a file (bad file name, invalid path,
bad sectors, can't overwrite read-only file, and so on.)

If necessary, you can start with a MsgBox letting the user know the
operation is about to happen, e.g.:
If MsgBox("About to create A: file", vbOkCancel) = vbOk Then
Docmd.TransferSpreadsheet ...
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top