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
 
Joined
May 24, 2006
Messages
5
Reaction score
0
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
 

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