Help with button code - email

M

Mike B

I have create a form and a button to send emails. The button has the
following code behind it comes back with an Error. The Field that contain
the email address is "email1".

The Error message I get is,

RunTime Error 7980
The HyperlinkAdresss or HyperlinksubAddress property is read-only for this
Hyperlink.

When I do a debug the line below with the "***" is highlighted.

I have used this code before and never had a problem, what did I do wrong?

Thanks,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~



The code is,

Private Sub Command29_Click()

Dim Hlk As Hyperlink
Dim MailStr As String

If Not IsNull([email1]) Then
MailStr = "mailto:" + [email1]
Set Hlk = email1.Hyperlink
Hlk.address = MailStr
Else
MsgBox "Please Enter an E-Mail Address"
MailStr = "mailto:"
Set Hlk = email.Hyperlink
*** Hlk.address = MailStr
Exit Sub
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top