M
Matthew
I have found the sample database Contacts, which has an
example of sending an email. I have taken the code from
there and have tried to adjust to meet my needs.
What I would like to do is not send an email to just the
one person but to everyone listed in the form. Also rather
than a single email to each person, I would like 1 email
to everyone.
When I push the command button currently even though all
the emails are in the form it only, does the first email
in the list.
Is there a way to get all the emails in the form into the
email I will be sending.
I have a form which has the Field [txtEmailName] and a
Command Button cmdEmail
I also have the follow code:
On the OnClick button on the Command button:
Private Sub cmdEmail_Click()
On Error GoTo HandleErr
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
EnableEmail
ExitHere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, _
, "Form_Contact.cmdEmail_Click"
End Select
Resume ExitHere
End Sub
On the OnCurrent button for the form.
Private Sub Form_Current()
On Error Resume Next
EnableEmail
End Sub
Private Sub EnableEmail()
' Update the email button
On Error Resume Next
cmdEmail.HyperlinkAddress = "mailto: " & [txtEmailName]
End Sub
Any help will be gratefully received.
Thanks
M
example of sending an email. I have taken the code from
there and have tried to adjust to meet my needs.
What I would like to do is not send an email to just the
one person but to everyone listed in the form. Also rather
than a single email to each person, I would like 1 email
to everyone.
When I push the command button currently even though all
the emails are in the form it only, does the first email
in the list.
Is there a way to get all the emails in the form into the
email I will be sending.
I have a form which has the Field [txtEmailName] and a
Command Button cmdEmail
I also have the follow code:
On the OnClick button on the Command button:
Private Sub cmdEmail_Click()
On Error GoTo HandleErr
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
EnableEmail
ExitHere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, _
, "Form_Contact.cmdEmail_Click"
End Select
Resume ExitHere
End Sub
On the OnCurrent button for the form.
Private Sub Form_Current()
On Error Resume Next
EnableEmail
End Sub
Private Sub EnableEmail()
' Update the email button
On Error Resume Next
cmdEmail.HyperlinkAddress = "mailto: " & [txtEmailName]
End Sub
Any help will be gratefully received.
Thanks
M