T
Tim
Hello all,
I have a piece of code that outputs a report and saves it as a .snp file by
the report name, ie rptA-Recap.snp. To give the .snp file a unique name, I
want to pull a record from the "Branch" field of the table "tlbBrDateTemp",
then add it to the name of the file. There is only one piece of data in the
table, so I just need to pull the first branch record.
I think I need something like MyBr = Branch.tlbBrDateTemp but I am not sure.
Following is my current code...
Public Function ReportDownload3()
Download3
End Function
Public Sub Download3()
Dim rpt As Access.Report
Dim path As String
Dim target As String
Dim MyUser As String
Dim MyName As String
Dim MyBr As String
Dim stDocName As String
Dim stOutputName As String
path = Environ("HOMEDRIVE") ' determine the windows drive
target = Environ("HOMEPATH") ' determine the documents and settings folder
MyUser = Environ("USERNAME")
MyBr = This is the code I don't know!!!!
MyName = Screen.ActiveReport.Name
stDocName = MyName
stOutputName = "C:\Documents and Settings\" & MyUser & "\My Documents\"
& MyName & ".snp"
DoCmd.OutputTo acReport, stDocName, acFormatSNP, stOutputName, True
End Sub
This code give the file the name "rptA-Recap.snp. I wan to attach MyBr so
it will look like "rptA-Recap018.snp"
Thanks all
I have a piece of code that outputs a report and saves it as a .snp file by
the report name, ie rptA-Recap.snp. To give the .snp file a unique name, I
want to pull a record from the "Branch" field of the table "tlbBrDateTemp",
then add it to the name of the file. There is only one piece of data in the
table, so I just need to pull the first branch record.
I think I need something like MyBr = Branch.tlbBrDateTemp but I am not sure.
Following is my current code...
Public Function ReportDownload3()
Download3
End Function
Public Sub Download3()
Dim rpt As Access.Report
Dim path As String
Dim target As String
Dim MyUser As String
Dim MyName As String
Dim MyBr As String
Dim stDocName As String
Dim stOutputName As String
path = Environ("HOMEDRIVE") ' determine the windows drive
target = Environ("HOMEPATH") ' determine the documents and settings folder
MyUser = Environ("USERNAME")
MyBr = This is the code I don't know!!!!
MyName = Screen.ActiveReport.Name
stDocName = MyName
stOutputName = "C:\Documents and Settings\" & MyUser & "\My Documents\"
& MyName & ".snp"
DoCmd.OutputTo acReport, stDocName, acFormatSNP, stOutputName, True
End Sub
This code give the file the name "rptA-Recap.snp. I wan to attach MyBr so
it will look like "rptA-Recap018.snp"
Thanks all