E
Erick C
Hello again everybody.
I have a new problem that I cannot figure out. I want to set up a
button to open a dialog box that will allow a user to select the
folder that a table will be exported to. I have copied the code from
http://www.mvps.org/access/api/api0002.htm into its own module (I am
already using the api0001 code). I then used a code from Ken Snell
for the button. The code is below:
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String, strBrowseMsg As String
Dim blnHasFieldNames As Boolean
strBrowseMsg = "Select the folder where the High Level file will be
created:"
strPath = BrowseFolder(strBrowseMsg)
If strPath = "" Then
MsgBox "No folder was selected.", vbOK, "No Selection"
Exit Sub
End If
strFile = " FormatDateTime(Now(),4) &”High Level Report.xls"
strTable = "High Level Summary by Subinventory"
strPathFile = strPath & "\" & strFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
strTable, strPathFile
I did modify the strFile because I wanted the date to pull in as part
of the file name.
When the button is pressed I get a dialog box that opens, but the file
that gets created in the folder that is chosen is all messed up.
There is just an empty file with no .xls or anything on the end of the
file, a name of 11, and the file size is 0.
What did I do wrong? Which code is causing my issues?
Any help would be greatly appreciated.
Erick
I have a new problem that I cannot figure out. I want to set up a
button to open a dialog box that will allow a user to select the
folder that a table will be exported to. I have copied the code from
http://www.mvps.org/access/api/api0002.htm into its own module (I am
already using the api0001 code). I then used a code from Ken Snell
for the button. The code is below:
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String, strBrowseMsg As String
Dim blnHasFieldNames As Boolean
strBrowseMsg = "Select the folder where the High Level file will be
created:"
strPath = BrowseFolder(strBrowseMsg)
If strPath = "" Then
MsgBox "No folder was selected.", vbOK, "No Selection"
Exit Sub
End If
strFile = " FormatDateTime(Now(),4) &”High Level Report.xls"
strTable = "High Level Summary by Subinventory"
strPathFile = strPath & "\" & strFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
strTable, strPathFile
I did modify the strFile because I wanted the date to pull in as part
of the file name.
When the button is pressed I get a dialog box that opens, but the file
that gets created in the folder that is chosen is all messed up.
There is just an empty file with no .xls or anything on the end of the
file, a name of 11, and the file size is 0.
What did I do wrong? Which code is causing my issues?
Any help would be greatly appreciated.
Erick