Hello,
I wonder if some kind person might be able to point me in the right direction regarding a problem I have encountered? Basically I am trying to create a command button that will 'On Click' first open my report and then open a dialogue box that will show the proposed path where I want the report to be saved to, taking the reports name and saving it as a .snp file.
I looked at various examples that were around but despite trying to adapt it for my use it comes up with a compile error: invalid qualifier?
The code I have used so far is:-
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click
Dim stDocName As String
stDocName = "Examination Paper Week 1 Questions"
DoCmd.OpenReport stDocName, acPreview
DoCmd.OutputTo _
acOutputReport, , acFormatSNP, _
"C:\Documents and Settings\Nigel\My Documents\Exam Archive\" & stDocName.Name & ".snp", True
Exit_Command18_Click:
Exit Sub
Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click
End Sub
I thought that this code would be OK because somebody said it worked alright for them but it doesn't for me and now I am fumbling around for a solution!!!!
Your help in solving my problem would be extremely well appreciated.
Kind Regards
CarolW
I wonder if some kind person might be able to point me in the right direction regarding a problem I have encountered? Basically I am trying to create a command button that will 'On Click' first open my report and then open a dialogue box that will show the proposed path where I want the report to be saved to, taking the reports name and saving it as a .snp file.
I looked at various examples that were around but despite trying to adapt it for my use it comes up with a compile error: invalid qualifier?
The code I have used so far is:-
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click
Dim stDocName As String
stDocName = "Examination Paper Week 1 Questions"
DoCmd.OpenReport stDocName, acPreview
DoCmd.OutputTo _
acOutputReport, , acFormatSNP, _
"C:\Documents and Settings\Nigel\My Documents\Exam Archive\" & stDocName.Name & ".snp", True
Exit_Command18_Click:
Exit Sub
Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click
End Sub
I thought that this code would be OK because somebody said it worked alright for them but it doesn't for me and now I am fumbling around for a solution!!!!
Your help in solving my problem would be extremely well appreciated.
Kind Regards
CarolW