Verify file exists before executing TransferText

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

Guest

How can I verify that a file exists before I execute the TransferText. I
would like a message to display if the file that I am trying to import does
not exist.

Here is my command:
DoCmd.TransferText acImportDelim, _
"Dailyrpt Import Specification", _
"Dailyrpt", _
[Forms]![Menu]![Path2] & "/dailyrpt.txt"

It works perfectly as long as the dailyrpt.txt file is present. If the file
isn't there, the user needs to know that via a message.

Thanks!
 
How can I verify that a file exists before I execute the TransferText. I
would like a message to display if the file that I am trying to import does
not exist.

Here is my command:
DoCmd.TransferText acImportDelim, _
"Dailyrpt Import Specification", _
"Dailyrpt", _
[Forms]![Menu]![Path2] & "/dailyrpt.txt"

It works perfectly as long as the dailyrpt.txt file is present. If the file
isn't there, the user needs to know that via a message.

Thanks!
 
Back
Top