Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving reports in .snp format

Status
Not open for further replies.

DBAMJA

Programmer
Jul 25, 2003
169
US
I run a series of reports every month for 24 different sites. Each site gets the same set of reports that are specific to their location. What I am trying to do is save killing so many trees and send the reports by email. I have no problem sending emails, its saving the reports programatically so I can retrieve them to send to each site. I just can't figure out the code to save each report off. I want to name them like: Final_Order_100.snp where the number 100 is the store number that will change.

Hope I explained this so you can understand.

[flush]

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
in VBA you could run the reports through a loop of the customers, then play with the DoCmd.OutputTo().

A point in the right direction?

"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
 
That's what I want to do but I can't figure out in the loop how to limit the report to one store and use the docmd.outputto command.



[flush]

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
How are you opening the report? Is the report one big long report with all the stores?

I've always had a form to open the reports in preview mode for the user's enjoyment. With that form, I would have a combo box and let the user select what report. You could include another field for a customer number, then utilize that field (Forms!frmOpenReport!txtCustID.value) in the onopen event of the form to select the customer.

"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
 
Boy, talk about having a brain fart today. I figured this out. I just open the report for a selected store using the docmd.openreport and then once the report is open I just used the docmd.outputto command to save the report and continue on from there.

Sometimes it just takes seeing the question on the screen to have it make sense.



[flush]

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
Just for grins, here is the code that I am using.

In this case, I am looking to see if there is a compound report for a given store, if there is...

If rs!compounds = -1 Then
DoCmd.OpenReport "Compounds", acViewPreview, , "Store_Number = " & rs!Store_Number
DoCmd.OutputTo acOutputReport, "Compounds", "Snapshot Format", "c:\data\storeemail\Compounds" & rs!Store_Number & ".snp"
DoCmd.Close acReport, "Compounds"
End If


[flush]

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top