Problem with sending email automatically

philbennison

Registered User.
Local time
Today, 16:22
Joined
Nov 10, 2004
Messages
49
i have recently created a database, there are 4 tables all linked. everything was working fine. i have two combo lists which were referenced to two other tables. these were entered as value lists. i then changed these to refer directly to the table. since then my email doesnt work.

I have taken everything apart and rebuilt it, but things that worked before dont work now.

Please help !!

Phil

Private Sub command_Click()
On Error GoTo Err_command_Click

Dim strEmail As String
Dim strDoc As String


strEmail = Me.email
strDoc = "defect_notification"
strSubject = "subject"
strMessage = "message"

DoCmd.SendObject , acReport, strDoc, strEmail, , , , , False

Exit_command_Click:
Exit Sub

Err_command_Click:
MsgBox Err.Description
Resume Exit_command_Click

End Sub
 
First remove the comma between SendObject and acReport.
This is putting all your parameters 1 place out.
Second observation probably doesn't matter, but the constant for sendobject is acSendReport, not acReport, but they possably equal the same integer value making it immaterial.

Hope removing the comma does the trick.

Regards

Richard
 
thanks for that, however the problem seems to be with the line

strEmail = Me.email

i have now substituted for

strEmail = Forms!main_form!email

Which seems to work

Thanks for the help
 
Last edited:

Users who are viewing this thread

Back
Top Bottom