Hi,
I have the following code:
But the line with DoCmd does only opens a mailmessage the first time. If I do it once, I need to close the database and open it again to get another email message.
Any1 an idea of what is going wrong here?
I have the following code:
Code:
On Error GoTo fout
Dim varTo, varFrom, varSubject, varBody As String
Dim sqlstring As String
Dim tmpsessionid As String
sqlstring = "select * from dbo_CONTACT where COCONTACTid = " & Me.CACONTACT
Dim db As Variant, rst, rst2 As Recordset
Dim Value1
Debug.Print sqlstring
Set db = CurrentDb
Set rst = db.openrecordset(sqlstring)
varTo = rst![COEMAIL]
varSubject = "xCA.Support S" & CACALLID & ": " & CATITLE
If rst![COLANG] = "NL" Then
varBody = "Beste "
End If
Debug.Print varBody
DoCmd.SendObject acSendNoObject, , , varTo, , , varSubject, varBody
Exit Sub
fout: MsgBox "Mail werd niet verstuurd"
End Sub
Any1 an idea of what is going wrong here?