I have a table in Access 2003 called "GL Balances"
I would like to export this on a form to the below location but naming the file with "Balances 03/03/2011" but i would like the date to change each day. So its like excel =WORKDAY(Today(),-1)
Location
G:\Asset Services MI\UnMatched Merit\Balances
Does anyone have the code to achieve this?
Thanks
Seamus
Microsoft Access
Last Comment
Seamus2626
8/22/2022 - Mon
als315
It is impossible to save file with "/" in name.
You can use "_" or "-" or "."
Seamus2626
ASKER
Yeah, theres no need for it to have /, 03032011 is fine
Thanks
Seamus
als315
Dim path As String
path = "G:\Asset Services MI\UnMatched Merit\Balances\Balances "
path = path & Format(Now(), "mm_dd_yyyy.xls")
Then you can use this file name in export command.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Seamus2626
ASKER
Im a code novice, so am womdering where i would put it in the export
Also, that looks like today, is there workday-1 in Access code?
Thanks
Seamus
als315
Dim path As String, D As Date
D = DateDiff("d", Now(), 1)
D = DateValue("05.03.2011")
While Weekday(D) = vbSunday Or Weekday(D) = vbSaturday
D = DateAdd("d", -1, D)
Wend
path = "G:\Asset Services MI\UnMatched Merit\Balances\Balances "
path = path & Format(D, "mm_dd_yyyy.xls")
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
You can use "_" or "-" or "."