Emailing from a subform

jmack

New member
Local time
Today, 19:30
Joined
Sep 17, 2003
Messages
6
I am trying to email from a subform by using a command button on the subform however it is not working. It works fine when I open the subform by itself but not when I open the mainform. I am pulling the email address from the mainform. When I click on the command button nothing happens. Can anyone help ?
 
What is the code behind the command button?
 
This is the code I'm using:

Private Sub cmdEmail_Click()
On Error Resume Next
cmdEmail.HyperlinkAddress = "mailto:" & Me!EmailName
End Sub
 
I'm not expert on this, but don't you need a:
.Hyperlink.Follow
in there somewhere?
 
I'm not sure but the command button works perfectly when I open the subform only. Why does it lose focus when I open the mainform and attempt to execute it ?
 
Perhaps it has to do with this part of the expression:
Me!EmailName
Try replacing it temporarily with a valid literal value when opening it as a subform and see if that bypasses the problem.
 

Users who are viewing this thread

Back
Top Bottom