Report To Snapshot

M

Melissa

Hi there

I have created a report "rptInvoice", there is a button to preview the
invoice, and then a button to "Save" the invoice.

This is the code for the "Save Invoice" option, which saves the "rptInvoice"
to the "default access folder" C:\documents & settings\my documents, etc.
This works fine. However, how would I specify a path in this code to save
the report to a different folder to what the access default is set to?

Thank you

Melissa
Code:

Private Sub Command15_Click()
On Error GoTo Err_Command15_Click

Dim stDocName As String
Dim Name As String

stDocName = "rptInvoice"
Name = [Forms]![frmCompany]![frmInvoice]![Name]

DoCmd.OutputTo acOutputReport, stDocName, ".snp", Name


Exit_Command15_Click:
Exit Sub

Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click

End Sub
 
G

ghetto_banjo

The full description of docmd.outputto is:
expression.OutputTo(ObjectType, ObjectName, OutputFormat, OutputFile,
AutoStart, TemplateFile, Encoding)


You can specify the whole file path for the OutputFile option. So
your name variable could be updated to something like:

Name = "C:\" & Name

Which would save the file directly to your C: drive.
 
D

Dale Fye

Melissa,

Take a look at the code at the following web site. With it, you can call
the Windows BrowseFolderDialog API and get a folder name.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
M

Melissa

Hi there

Thank you kindly for your reply, what is the website address?

Thank you

Melissa


Dale Fye said:
Melissa,

Take a look at the code at the following web site. With it, you can call
the Windows BrowseFolderDialog API and get a folder name.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



Melissa said:
Hi there

I have created a report "rptInvoice", there is a button to preview the
invoice, and then a button to "Save" the invoice.

This is the code for the "Save Invoice" option, which saves the
"rptInvoice"
to the "default access folder" C:\documents & settings\my documents, etc.
This works fine. However, how would I specify a path in this code to save
the report to a different folder to what the access default is set to?

Thank you

Melissa
Code:

Private Sub Command15_Click()
On Error GoTo Err_Command15_Click

Dim stDocName As String
Dim Name As String

stDocName = "rptInvoice"
Name = [Forms]![frmCompany]![frmInvoice]![Name]

DoCmd.OutputTo acOutputReport, stDocName, ".snp", Name


Exit_Command15_Click:
Exit Sub

Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click

End Sub
 
D

Dale Fye

Oops, my bad.

http://www.mvps.org/access/api/api0002.htm

Dale

Melissa said:
Hi there

Thank you kindly for your reply, what is the website address?

Thank you

Melissa


Dale Fye said:
Melissa,

Take a look at the code at the following web site. With it, you can call
the Windows BrowseFolderDialog API and get a folder name.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



Melissa said:
Hi there

I have created a report "rptInvoice", there is a button to preview the
invoice, and then a button to "Save" the invoice.

This is the code for the "Save Invoice" option, which saves the
"rptInvoice"
to the "default access folder" C:\documents & settings\my documents, etc.
This works fine. However, how would I specify a path in this code to save
the report to a different folder to what the access default is set to?

Thank you

Melissa
Code:

Private Sub Command15_Click()
On Error GoTo Err_Command15_Click

Dim stDocName As String
Dim Name As String

stDocName = "rptInvoice"
Name = [Forms]![frmCompany]![frmInvoice]![Name]

DoCmd.OutputTo acOutputReport, stDocName, ".snp", Name


Exit_Command15_Click:
Exit Sub

Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top