Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now
Private Sub Command25_Click() On Error GoTo Err_Command25_Click Dim dbs As DAO.Database Dim rst As DAO.Recordset Dim strSQL As String Dim lngBookingID As Long Dim strEmail As String strSQL = "SELECT BookingID,StudentEmail From qryBookingIDAndStudentEmail" Set dbs = CurrentDb() Set rst = dbs.OpenRecordset(strSQL) rst.MoveFirst Do While Not rst.EOF lngBookingID = rst!BookingID strEmail = rst!StudentEmail DoCmd.SendObject acSendReport, "rptBookingConfirmationEmail", acFormatHTML, strEmail, , , "Confirmation of Needs Assessment Booking.", "Please find attached details of your pending appointment at CLASS", True rst.MoveNext Loop lngpubBookingID = 0 MsgBox "Done", vbInformation rst.Close Set rst = Nothing dbs.Close Set dbs = Nothing Exit_Command25_Click: On Error Resume Next rst.Close Set rst = Nothing dbs.Close Set dbs = Nothing Exit Sub Err_Command25_Click: If Err.Number = 2501 Then Resume Exit_Command25_Click Else MsgBox "There was an error sending the email" & vbCrLf & vbCrLf & Err.Number & ": " & vbCrLf & vbCrLf & Error, vbExclamation Resume Exit_Command25_Click End If End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.