Access Transfer Text -how to save current date as file name

Joined
May 24, 2006
Messages
5
Reaction score
0
need to write a macro that includes the current date in the filename when saving the output.

Example: In Macro
Transfer Type: Export Delimited
Specification: History Export Specification
Table Name: History
File Name: R:\History05012006.txt <-----how to write current date in the file name?

Thank you for your time
Shan
 
Problem Solved

problem solved. I run this script to rename the file name and it works!

Public Function ChangeFileName()
Dim Oldname As String

Dim NewName As String

Dim CurrentDate As Date

CurrentDate = Date
Oldname = "R:\click2learn\Bulk Registration\" _
& "Source Data File\TrainingHistory Files\" _
& "2006 Compliance Deployments\TrainingHistory.txt"

NewName = "R:\click2learn\Bulk Registration\" _
& "Source Data File\TrainingHistory Files\" _
& "2006 Compliance Deployments\TrainingHistory" & Format$(CurrentDate, "mm-dd-yyyy") & ".txt"

Name Oldname As NewName


End Function
 
Back
Top