N
NoLegalMoves via AccessMonster.com
I have a form which has a button that should export the values of the
corresponding report to a snapshot file. (The file name is based on the
report name to which I added the value of a filed in my form (to
differenciate each exported report))
I would like this to happen without opening the report if possible.
I have the following code so far. It returns the error that the report is not
opened or misspelled.
I have tried to open the report, export then close the report, but it is
still not working..
report name : RP_Processing
Private Sub Export_Click()
On Error GoTo Err_Export_Click
Dim stDocName As String
Dim filepath As String
Dim strFieldName As String
Dim strRpt As String 'name of Access report
filepath = "C:\Batch info\" & "RP_Processing" & " " & Reports!
[RP_Processing]![Production order #] & ".snp"
strRpt = "RP_Processing"
DoCmd.OutputTo acOutputReport, strRpt, "Snapshot Format", filepath, False
Exit_Export_Click:
Exit Sub
Err_Export_Click:
MsgBox Err.Description
Resume Exit_Export_Click
End Sub
corresponding report to a snapshot file. (The file name is based on the
report name to which I added the value of a filed in my form (to
differenciate each exported report))
I would like this to happen without opening the report if possible.
I have the following code so far. It returns the error that the report is not
opened or misspelled.
I have tried to open the report, export then close the report, but it is
still not working..
report name : RP_Processing
Private Sub Export_Click()
On Error GoTo Err_Export_Click
Dim stDocName As String
Dim filepath As String
Dim strFieldName As String
Dim strRpt As String 'name of Access report
filepath = "C:\Batch info\" & "RP_Processing" & " " & Reports!
[RP_Processing]![Production order #] & ".snp"
strRpt = "RP_Processing"
DoCmd.OutputTo acOutputReport, strRpt, "Snapshot Format", filepath, False
Exit_Export_Click:
Exit Sub
Err_Export_Click:
MsgBox Err.Description
Resume Exit_Export_Click
End Sub