nickrugado
MIS
I found some code and now I'm trying to troubleshoot it.
I have 2 issues.
the line with the ~~~~'s errors out and highlights the entire code to the end of the ~~~~'s
The second question I have is that I have placed this in a module, how do I call the module from the form when a button is placed?
Any help is greatly appreciated. Using Access 2003
Option Compare Database
Dim rsMsgInfo As DAO.Recordset
Dim objOutlookMsg As Object
~~~~rsMsgInfo = dgengine.OpenRecordset("SELECT emailer_currentcampaign.email FROM emailer_currentcampaign,dbOpenDynamic")~~~~
objOutlookMsg = objOutlook.CreateItem(olMailItem)
Do Until rsMsgInfo.EOF
With objOutlookMsg
.To = rsMsgInfo.Fields("EmailAddress")
.Body = "Dear " & rsMsgInfo.Fields("FirstName")
.Subject = "SOME SUBJECT:"
.Send
rsMsgInfo.MoveNext
Loop
rsMsgInfo.Close
I have 2 issues.
the line with the ~~~~'s errors out and highlights the entire code to the end of the ~~~~'s
The second question I have is that I have placed this in a module, how do I call the module from the form when a button is placed?
Any help is greatly appreciated. Using Access 2003
Option Compare Database
Dim rsMsgInfo As DAO.Recordset
Dim objOutlookMsg As Object
~~~~rsMsgInfo = dgengine.OpenRecordset("SELECT emailer_currentcampaign.email FROM emailer_currentcampaign,dbOpenDynamic")~~~~
objOutlookMsg = objOutlook.CreateItem(olMailItem)
Do Until rsMsgInfo.EOF
With objOutlookMsg
.To = rsMsgInfo.Fields("EmailAddress")
.Body = "Dear " & rsMsgInfo.Fields("FirstName")
.Subject = "SOME SUBJECT:"
.Send
rsMsgInfo.MoveNext
Loop
rsMsgInfo.Close