bradh_nz
01-13-2009, 01:54 AM
Hi
I have the below code to transfer a spreadsheet and name the spreadsheet based on an sql Query (HFile) however I cannot seem to get this to work. Any help appreciated.
-----------------------------------------
Option Compare Database
Function Export_RC()
Dim strInput As String
Dim strMsg As String
strInput = HFile
DoCmd.TransferSpreadsheet acExport, 8, "RC", "\\Chad-pl05\GIM\Systems\Issues\63 (file://\\Chad-pl05\GIM\Systems\Issues\63) - Basel Late Adjustments\2009 BASEL Update Work\" & strInput & ".xls", True, ""
End Function
-----------------------------------
Function HFile()
Dim db As Database
Dim Rs As Recordset
Dim sSQLstr As String
Set db = CurrentDb
sSQLstr = "SELECT Details.Hfile " & _
" FROM Details "
Set Rs = db.OpenRecordset(sSQLstr)
Rs.Close
End Function
I have the below code to transfer a spreadsheet and name the spreadsheet based on an sql Query (HFile) however I cannot seem to get this to work. Any help appreciated.
-----------------------------------------
Option Compare Database
Function Export_RC()
Dim strInput As String
Dim strMsg As String
strInput = HFile
DoCmd.TransferSpreadsheet acExport, 8, "RC", "\\Chad-pl05\GIM\Systems\Issues\63 (file://\\Chad-pl05\GIM\Systems\Issues\63) - Basel Late Adjustments\2009 BASEL Update Work\" & strInput & ".xls", True, ""
End Function
-----------------------------------
Function HFile()
Dim db As Database
Dim Rs As Recordset
Dim sSQLstr As String
Set db = CurrentDb
sSQLstr = "SELECT Details.Hfile " & _
" FROM Details "
Set Rs = db.OpenRecordset(sSQLstr)
Rs.Close
End Function