G
Guest
The code below works fine on the C:\ drive. When I transfer the database to a
server I have to manually replace C:\ by typing in the full UNC path for
every instance. What additions to the code do I have to make for it to be
able to run in either location?
Code
Dim StrBDM As String
Dim StrPath As String
StrBDM = ("qctb" & Forms![frmReportOps]![cboBDM])
StrPath = "C:\VolumeDatabase\Reports\" & txtFileName &
".xls"
DoCmd.SetWarnings False
Me.Form.Requery
DoCmd.CopyObject "C:\VolumeDatabase\ProcessReport.mdb",
StrBDM, acQuery, "qctbReport"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, StrBDM,
StrPath, True
DoCmd.DeleteObject acQuery, StrBDM
DoCmd.SetWarnings True
server I have to manually replace C:\ by typing in the full UNC path for
every instance. What additions to the code do I have to make for it to be
able to run in either location?
Code
Dim StrBDM As String
Dim StrPath As String
StrBDM = ("qctb" & Forms![frmReportOps]![cboBDM])
StrPath = "C:\VolumeDatabase\Reports\" & txtFileName &
".xls"
DoCmd.SetWarnings False
Me.Form.Requery
DoCmd.CopyObject "C:\VolumeDatabase\ProcessReport.mdb",
StrBDM, acQuery, "qctbReport"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, StrBDM,
StrPath, True
DoCmd.DeleteObject acQuery, StrBDM
DoCmd.SetWarnings True