Report To Snapshot

  • Thread starter Thread starter Melissa
  • Start date Start date
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
 
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.
 
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.
 
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
 
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
 
Back
Top