I'm a novice trying to get an access table exported to excel and have the excel file named based on the "Job Number" value in the Table "Job Info". I want this to happen by running a Macro that generates several reports, and at the same time exports the data. The reports part of the macro works fine, I just can't get the Output to excel to work. I've researched it on the forum and tried to write the coding based ideas in the forum. Here's what I've got, but it doesn't work. I get a compile error.
Option Compare Database
Dim stDocName As String
Dim stOrderNum As String
Dim stSubject As String
stDocName = "Filemaker Data - Excel" 'table to export
stOrderNum = [Tables].[Job Info].[Job Number] 'location of "job number"
stSubject = "FM" & stOrderNum & ".xls" 'named of exported file
DoCmd.OutputTo acReport,stDocName, acFormatxls, \\clo01\Drv F\FILEMAKER DATA\stSubject,True
Thanks for any help.
Option Compare Database
Dim stDocName As String
Dim stOrderNum As String
Dim stSubject As String
stDocName = "Filemaker Data - Excel" 'table to export
stOrderNum = [Tables].[Job Info].[Job Number] 'location of "job number"
stSubject = "FM" & stOrderNum & ".xls" 'named of exported file
DoCmd.OutputTo acReport,stDocName, acFormatxls, \\clo01\Drv F\FILEMAKER DATA\stSubject,True
Thanks for any help.