Delete file after import?

B

Brook

good day all,

I have a query that I run to update my checking account from a .csv file.
Is it possible to delete the actual import file after the import is complete?
Can I set a message saying the import was successful or has been completed?

Thanks,

Brook
 
K

Klatuu

The easiest way to do what you want would be to put something like the
following (Untested Air Code) in the Click Event of a command button:

On Error GoTo Click_Error

DoCmd.TransferSpreadsheet .......
If MsgBox("Do you want to Delete the import File?,vbQuestion + vbYesNo, _
"Import Completed") = vbYes Then
Kill "path and filename of import file goes here
End If

Click_Exit:
Exit Sub

Click_Error
MsgBox Err.Number & ": " & Err.Description, vbCritical + vbOKOnly, _
"Error Importing File"
Resume Click_Exit

End Sub
 

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

Top