crystalnewbie
MIS
I have a form with an email button that is supposed to open up an Outlook window. It does open the outlook window but it seems to be getting the email information from the first record and not the current record.
What am I missing here?
Thanks in advance.
---------------------------------------
Dim sBodyText As String
Dim sSubject As String
Dim sAddress As String
Dim dba As DAO.Database, rst As DAO.Recordset
Set dba = CurrentDb
Set rst = dba.OpenRecordset("contact directory")
sBodyText = "test"
sSubject = "your subject"
If Not IsNull(rst("e-mail")) Then
sAddress = rst("e-mail")
DoCmd.SendObject , , , sAddress, , , sSubject, sBodyText
End If
What am I missing here?
Thanks in advance.
---------------------------------------
Dim sBodyText As String
Dim sSubject As String
Dim sAddress As String
Dim dba As DAO.Database, rst As DAO.Recordset
Set dba = CurrentDb
Set rst = dba.OpenRecordset("contact directory")
sBodyText = "test"
sSubject = "your subject"
If Not IsNull(rst("e-mail")) Then
sAddress = rst("e-mail")
DoCmd.SendObject , , , sAddress, , , sSubject, sBodyText
End If