Private Sub viewEmail(strValues As String) On Error GoTo ErrorHandler Dim rs2 As DAO.Recordset Dim db2 As Database Dim strSQL2 As String Dim strPassedValue As String Dim intJobId As Integer Dim strTech As String Dim varVals As Variant Dim strEmailMessage As String strPassedValue = strValues 'Me.OpenArgs varVals = Split(strPassedValue, "/") intJobId = CInt(Trim(varVals(0))) strTech = Trim(varVals(1)) Set db2 = CurrentDb strSQL2 = "SELECT * FROM Schedule_Table WHERE JobID = " & intJobId & " AND Tech_Name = '" & strTech & "'" Set rs2 = db2.OpenRecordset(strSQL2) If rs2.RecordCount > 0 Then strEmailMessage = rs2![JobName] & vbLf strEmailMessage = strEmailMessage & rs2![VenueName] & vbLf strEmailMessage = strEmailMessage & rs2![AreaName] & vbLf Else MsgBox ("There was an issue generating the email text.") End If Me.txtEmailBody.Value = strEmailMessage ExitSub: ' Set rsScheduled = Nothing Exit Sub ErrorHandler: MsgBox "Error No: " & Err.Number _ & " in " & Me.ActiveControl.name & " procedure; " _ & "Description: " & Err.Description Resume ExitSub End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE