emailing from combo box

teiben

Registered User.
Local time
Today, 22:12
Joined
Jun 20, 2002
Messages
462
I have a combobox named: Champion the control source is EmailChamptionID, based on SQL statement
SELECT tblChampions.EmailChamptionID, tblChampions.Champions, tblChampions.cemailaddress FROM tblChampions;

I want the user to be able to select the persons name from the box, which has an email name associated with it cemailaddress. When a command button is selected the person is supose to get emailed, but I keep getting a compile error "method or data member not found" .cemailaddress

the line is:
Private Sub cmdNotifyChampion_Click()
DoCmd.SendObject , , , Me.EmailChamptionID.cemailaddress, , , "TS16949 Non-Conformance #" & Me.Text19 & "", "hello", False, ""

I've also tried

Docmd.SendObject , , , Me.cemailaddress, etc

I guess I'm refering to the email address incorrecly, how would I write it?
 
I believe the bound column of the combo box has to be cemailaddress (3). Hope this helps.
 
or if that doesn't work try

Private Sub cmdNotifyChampion_Click()

email = Me.EmailChamptionID.cemailaddress

DoCmd.SendObject , , , email, , , "TS16949 Non-Conformance #" & Me.Text19 & "", "hello", False, ""

or
email = Me.EmailChamptionID.cemailaddress.Fields(2)

You can try with a msgbox to test what works in your situation, but I would exclude the DoCmd in that case :)
 
Last edited:
Here is a sample based on your first post. Hope this is what you want.

If you look down the bottom of the code you will see explained all the sections of sendobject.
 
Last edited:
John A

I'm still using 97, could you post it in 97, I can't open it. Would be greatly appreciated.
 
teiben,

Here is it '97 format.
 
Last edited:
Thanks a million. It worked. I can probably use this code for other projects which I have hard coded.

Thanks again, your my hero
 

Users who are viewing this thread

Back
Top Bottom