pianoprodigy
Registered User.
- Local time
- Today, 17:33
- Joined
- Apr 22, 2003
- Messages
- 42
Automatically Sending A Report (1 record) as E-mail
I searched and found this code which seems to work; however, I just need to show one record on the report. Below is the code that I found...
Another button in the form calls the current record to simply print it using the following code:
Any ideas??? There are like 17,000 records in the table. I only want to display the one ID in this report. I've tried for hours, and I'm tired of guessing...
Thanks for the help!
Alan
I searched and found this code which seems to work; however, I just need to show one record on the report. Below is the code that I found...
Code:
Private Sub YourButton_Click()
Dim EmailApp, NameSpace, EmailSend As Object
DoCmd.OutputTo acOutputReport, "Report1", "snapshotformat", "C:\Temp\Report1.snp"
Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)
EmailSend.To = "email@wherever.bla"
EmailSend.Subject = "Your Subject Here"
EmailSend.Body = "Hello," & vbCrLf & vbCrLf & "Attached is the latest Snapshot"
EmailSend.Attachments.Add "C:\Temp\Report1.snp"
EmailSend.Send
Set EmailApp = Nothing
Set NameSpace = Nothing
Set EmailSend = Nothing
End Sub
Another button in the form calls the current record to simply print it using the following code:
Code:
Private Sub Command325_Click()
Me.Refresh
DoCmd.OpenReport "AISReport", acViewNormal, , "[ID] = " & Me("ID")
End Sub
Any ideas??? There are like 17,000 records in the table. I only want to display the one ID in this report. I've tried for hours, and I'm tired of guessing...
Thanks for the help!
Alan