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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Selected Report using Email Address

Status
Not open for further replies.

awl

IS-IT--Management
Aug 2, 2001
136
0
0
US
The below coding was graciously provided by OnTheFly and PHV. As I open “frmList of Individuals” which has a subform “frmAppointments”, I press the cmdPrint Current Record, it prints the selected “rptAppointment Letter” using the [ApptID] field, then closes “frmList of Individuals”. This works great. This new post though involves a new/additional action.

Instead of creating an additional command button to email the selected “rptAppointment Letter”, I would like to have this new action incorporated into the coding below, if it is possible. After the selected “rptAppointment Letter” is printed (1st action) and before the “frmList of Individuals” is closed, (3rd action), I want to email the selected “rptAppointment Letter” automatically to that individual using their [EMAddress], (2nd Action).

Two issues: 1) I currently have a macro, “macEmail Appt Letter” which when activated, sends all the “rptAppointment Letter”, (Snapshot Format) to the address that I select when Microsoft Outlook opens up. I only want the selected [ApptID] record sent, not all of the records. 2) I want to have the selected “rptAppointment Letter” sent automatically using the individual’s [EMAddress] that is part of the record source “qryList of Ind Appt Dates”, before closing “frmList of Individuals”. For testing purposes I left the To blank and in the Cc I placed my office email address in the setup in the macro action “SendObject”; in the final database I need to use the Cc in the macro action “SendObject”.

Can someone provide assistance in these two requests? Thank you!

Private Sub cmdPrint_Current_Record_Click()
Dim lngApptID As Long

lngApptID = Me!ApptID
DoCmd.OpenReport "rptAppointment Letter", acViewNormal, , "ApptID=" & lngApptID
DoCmd.Close acForm, "frmList of Individuals", acSaveNo

Exit_cmdPrint_Current_Record_Click:
Exit Sub

Err_cmdPrint_Current_Record_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Current_Record_Click

End Sub

 
I was hoping someone may have replied. However, for the 1st issue, I did create a Command Button on my "frmList of Individuals", using the “macEmail Appt Letter” to Email just the 1 selected record. I used the [ApptID] as the Enter Parameter Value from the "qryList of Ind Appt Dates (Email)". For the [Email Address] I left the To blank in the SendObject so I can type in the address. 1st issue resolved for now.
 
Could you please explain your method more clearly as it would really help me with what i am doind at the moment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top