Hello all,
From a form, I have been trying to send a simple email message to an email address specified in a drop down menu on an access form. I was helped greatly by members of a different Access forum yesterday, but unfortunately I never managed to solve my problem (and today people seem to have lost interest in my thread).
So yesterday, I carried out the following steps.
I Created and populated a table with 3 columns - autonumber, name and email address and populated this table.
I created a unbound combo drop down menu, showing only one column (name) and called it emailname.
I then created a form with a button on it. At the data tab of the button's properties I opened up a code builder box.
In between the following:
I pasted the following code:
This however brings up a complile error highlighting whichi is highlighted above with the message ' Method or data member not found'.
I've tried changing that name several times but to no joy. VBA is all new to me, so it's likely I'm making a very simple mistake.
Any help would be really appreciated.
Thanks a lot in advance
Jool
From a form, I have been trying to send a simple email message to an email address specified in a drop down menu on an access form. I was helped greatly by members of a different Access forum yesterday, but unfortunately I never managed to solve my problem (and today people seem to have lost interest in my thread).
So yesterday, I carried out the following steps.
I Created and populated a table with 3 columns - autonumber, name and email address and populated this table.
I created a unbound combo drop down menu, showing only one column (name) and called it emailname.
I then created a form with a button on it. At the data tab of the button's properties I opened up a code builder box.
In between the following:
Code:
Private Sub Command2_Click()
End Sub
I pasted the following code:
Code:
Dim strToWhom As String
Dim strMsgBody As String
Dim strSubject As String
strSubject = "Your Subject"
strToWhom = Me[COLOR="Red"].emailname[/COLOR].Column(2)
strMsgBody = "Your Body text goes here!"
DoCmd.SendObject , , , strToWhom, , , strSubject, strMsgBody, True
This however brings up a complile error highlighting whichi is highlighted above with the message ' Method or data member not found'.
I've tried changing that name several times but to no joy. VBA is all new to me, so it's likely I'm making a very simple mistake.
Any help would be really appreciated.
Thanks a lot in advance
Jool
