Trying to retrieve combobox text in the email body of outlook

dimanche 26 avril 2015

Hello All,

I am trying to fetch combobox dropdown text (in the networks label ) into the email body but in vain.

Me.cmb_Network_1_data.Text is giving the RowID instead of the text inside the combobox.


Whichever networks are selected in the six dropdowns should go to email body as you can find in the attachement




Thanks,
Kate


Code:

Sub update()
Dim oOutlook As Outlook.Application
Dim oEmailitem As MailItem
Dim bodytext As String
On Error Resume Next
Err.Clear
Set oOutlook = GetObject(, "Outlook.application")
If Err.Number <> 0 Then
Set oOutlook = New Outlook.Application
End If

Set oEmailitem = oOutlook.CreateItem(olMailItem)
With oEmailitem
.To = Me.EMAIL

.Subject = "Permissions Update - " & Me.FNAME & Space(1) & Me.LNAME & " -" & Me.SSO & "-QCId_" & Me.QCID

bodytext = "Hi" & Me.FNAME & "<br><br>" & _
"Welcome!" & "<br><br>" & _
"A new user account has been created for you with Sales Assistant access (LA team) for the following network(s):" & _
Me.cmb_Network_1_data.Text


.HTMLBody = bodytext

.Display
End With
Set oEmailitem = Nothing
Set oOutlook = Nothing
End Sub


Attached Files
File Type: accdb networks.accdb (1.40 MB)
Trying to retrieve combobox text in the email body of outlook

0 commentaires:

Enregistrer un commentaire

Labels