next record "line" of a database table
Hi I am using this code, which when i run a qeary it returns me in a form customer personal details.
in one column is called EMail
on the form i can click a button, which opens outook and puts the first email address into an email to ready to send.
but i want all the customers returned email adresses to be added to the same email as a global email. here is the code.... so far
Private Sub SendAnEmail_Click()
On Error GoTo ErrorHandler
Dim objOutlook As Object 'Outlook.Application
Dim EmailAddress As String
Set objOutlook = CreateObject("Outlook.Application")
Set objMailItem = objOutlook.CreateItem(0)
DoCmd.RunCommand acCmdSaveRecord
EmailAddress = Me!EMail
With objMailItem
.To = EmailAddress
.Subject = "Subject Here"
.body = "email text Here"
.display
End With
Exit Sub
ErrorHandler:
MsgBox "Error Number:" & Err.Number & "" & Err.Description
End Sub
what i need is some code in here that reads each of the next lines in the table to get just all the email addresses. i have tried with no luck... any help
regards
jofoxy
|