I have an Access 2010 Database that runs automatically every Monday morning. There are 2 queries run and the results of each are exported to an Excel file. Then those 2 files are emailed to the recipients. This all works fine the only issue I'm having is that if I get busy and forget to rename the files the next Monday the process errors because the files already exist. I know there's a way in Access VBA to rename those files so after the email is sent I would like to rename both files by adding the rundate to the filename.
For Example:
Filename of the emailed file is Claim_Audits_Professional and Claim_Audits_Facility
After the files are emailed I want to change the filenames To: Claim_Audits_professional_01052018 and Claim_Audits_Facility_01052018
I know I've done this before I just don't remember how and I've been looking through the documentation but can't find what I'm looking for. Any help is appreciated.