TransferSpreadsheet user to select directory

T

Tiffany

Hi,
I am using this function to get the user to select the directory to save
some files.
But I don't want the user to type in the filename, I want to hard code the
file name + add last month's name to the file. How can I add the date as a
variable to the filename??
Function Save_FileName() As String
Dim strFilter As String
Dim lngFlags As Long
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)", _
"*.xls")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strSaveFileName = ahtCommonFileOpenSave(OpenFile:=False, _
Filter:=strFilter, _
Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
If (strSaveFileName <> "") Then

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "query",
"file", True, "query"

But as well as this file, I have about 10 other files that I'm exporting,
and will be saving into the same directory, so I don't want to name the file
in the ahtCommonFileOpenSave function 10 times. I just want to get the user
to select the directory once then all 10 files get saved in there.
Can someone pls help??
 

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