Delete file after import?

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

Guest

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
 
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
 
Back
Top