Here is my situation. I have a function that opens up a report that prints out a single report for each value in a query that I have for certain job numbers. I know that I can manipulate this to output each report to a snapshot file and then send them on to each of the co-workers using a combination of the code I have with this function and other code that I have used before to do something similar. What I would like to be able to do is to possibly shell to winzip and zip all of the snapshot files up before I send them off in an e-mail. Below I have the current function:
Function RockinLikeFreightTrain()
Dim dbsreport As Database
Dim rstReport As Recordset
Dim astro As QueryDef
Dim qdy As QueryDef
Set dbsreport = CurrentDb
Set astro = dbsreport.CreateQueryDef("temp_query", "SELECT tbl_man.job_num " & _
"FROM tbl_man GROUP BY tbl_man.job_num;"
Set qdy = dbsreport.QueryDefs("temp_query"
Set rstReport = qdy.OpenRecordset()
With rstReport
Do While Not .EOF
StreetBall = ![job_num]
.MoveNext
DoCmd.OpenReport "rpt_crosstb_test", acViewNormal
DoCmd.Close acReport, "rpt_crosstb_test"
Loop
End With
dbsreport.QueryDefs.Delete ("temp_query"
rstReport.Close
End Function
My other code that I am going to pull from to get the appropriate info is below:
Function TheJuiceIsLoose()
Dim stDocName As String
Dim stDogName As String
Dim stDicName As String
Dim appoutlook As Outlook.Application
Dim mailoutlook As Outlook.MailItem
Set appoutlook = CreateObject("outlook.application"
Set mailoutlook = appoutlook.CreateItem(olMailItem)
stDocName = "rpt_crosstb"
stDogName = InputBox("Enter Time Sheet Description"
stDicName = "N:\Shared\ppe_" & stDogName & ".snp"
DoCmd.OutputTo acOutputReport, stDocName, "Snapshot Format", stDicName
With mailoutlook
.To = "obb@who.com;tbl@who.com"
.Subject = "PPE " & stDogName
.Attachments.Add stDicName
.Display
End With
End Function
Please let me know what you think as I do not like to send individual reports to these people.
Thank you
Function RockinLikeFreightTrain()
Dim dbsreport As Database
Dim rstReport As Recordset
Dim astro As QueryDef
Dim qdy As QueryDef
Set dbsreport = CurrentDb
Set astro = dbsreport.CreateQueryDef("temp_query", "SELECT tbl_man.job_num " & _
"FROM tbl_man GROUP BY tbl_man.job_num;"
Set qdy = dbsreport.QueryDefs("temp_query"
Set rstReport = qdy.OpenRecordset()
With rstReport
Do While Not .EOF
StreetBall = ![job_num]
.MoveNext
DoCmd.OpenReport "rpt_crosstb_test", acViewNormal
DoCmd.Close acReport, "rpt_crosstb_test"
Loop
End With
dbsreport.QueryDefs.Delete ("temp_query"
rstReport.Close
End Function
My other code that I am going to pull from to get the appropriate info is below:
Function TheJuiceIsLoose()
Dim stDocName As String
Dim stDogName As String
Dim stDicName As String
Dim appoutlook As Outlook.Application
Dim mailoutlook As Outlook.MailItem
Set appoutlook = CreateObject("outlook.application"
Set mailoutlook = appoutlook.CreateItem(olMailItem)
stDocName = "rpt_crosstb"
stDogName = InputBox("Enter Time Sheet Description"
stDicName = "N:\Shared\ppe_" & stDogName & ".snp"
DoCmd.OutputTo acOutputReport, stDocName, "Snapshot Format", stDicName
With mailoutlook
.To = "obb@who.com;tbl@who.com"
.Subject = "PPE " & stDogName
.Attachments.Add stDicName
.Display
End With
End Function
Please let me know what you think as I do not like to send individual reports to these people.
Thank you