Save to specified directory as .SNP file - problem??

CarolW

Registered User.
Local time
Yesterday, 23:27
Joined
Mar 24, 2006
Messages
58
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
 
You have declared stDocName as a string. In VB(A) strings don't have methods or properties, so replace your stDocName.Name with stDocName in the OutPUtTo thingie.
 
Save to directory as.SNP file - slightly confused?

RoyVidar said:
You have declared stDocName as a string. In VB(A) strings don't have methods or properties, so replace your stDocName.Name with stDocName in the OutPUtTo thingie.
Good afternoon RoyVidar,
Many thanks for the very prompt response however I'm still unsure as to what you mean? I am still very new to this sort of thing and as a consequence would gratefully ask if you could amend my code so that I might
see a visual example of this? Hope you don't mind helping me further.

Thanks ever so much....Hope you can help further....??


Regards

CarolW
 
I'm not sure how to say this without sounding rude, but do you have problems with the instruction of finding an occurance of "stDocName.Name" in your code, and replace it with only "stDocName"?
 
Save to specified directory - now see what you mean?

RoyVidar said:
I'm not sure how to say this without sounding rude, but do you have problems with the instruction of finding an occurance of "stDocName.Name" in your code, and replace it with only "stDocName"?

Hello RoyVidar,
My apologies...
You are not at all rude - it's me getting confused again, which happens alot?
I now see what you mean?
I will give the code a go when I next go back to work, and I'll let you know the outcome??

Your help and guidance is very much appreciated.

Regards

CarolW
 

Users who are viewing this thread

Back
Top Bottom