Syntax to combine transfer spreadsheet & Openfilesave API

  • Thread starter Thread starter Hugh self taught
  • Start date Start date
H

Hugh self taught

Hi,

I have the following which is incomplete & I need some assistance with it. I
want to export table "Competitors" to a spreadsheet called "Competitors" but
I want to select where I save it. I'd prefer it if the name was automatically
populated in the save filename field to enforce consistancy.

Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)", "*.xls")
'strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=False, _
DialogTitle:="Please select file...", _
Flags:=ahtOFN_HIDEREADONLY)

DoCmd.TransferSpreadsheet acExport, 8, Competitors, (strFilter \
"Competitors.xls"), True
 
Thanks Ken, I've got that working great. Now the other part of my post was
whether or not the file name could be automated for convenience & consistancy?
 
Thanks Ken, I've got that working great. Now the other part of my post was
whether or not the file name could be automated for convenience & consistancy?
 
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=False, _
DialogTitle:="Please select file...", _
Flags:=ahtOFN_HIDEREADONLY, _
FileName:="Competitors.xls")
 
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=False, _
DialogTitle:="Please select file...", _
Flags:=ahtOFN_HIDEREADONLY, _
FileName:="Competitors.xls")
 
Back
Top