Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple E-mails from form controls.

Status
Not open for further replies.

aqua56

IS-IT--Management
Apr 21, 2002
3
GB
I have an Access database form, where projects are tracked by entering dates as each step is completed.

I need to e-mail simple text reports for each step.

When a user double-clicks, these boxes the date is automatically inserted and we use the DoCmd.SendObject to send an e-mail, although no attachment is required.

This works continuosly on any single box, i.e. if I keep clicking, it keeps sending the message, but if we then move to the second or third boxes, no mail is sent.

When I use an error handler to show errors, the Alert pops up showing error code "0"

The variables have been declared both in the Sub's and at the top of the module as shown below.

Can anyone point us in the right direction.

Many thanks

Derek.




Option Explicit
Option Compare Database
Dim ClientMail, FaultRef, Cat As String
Dim Custr, FR


Private Sub C_Time_DblClick(Cancel As Integer)
On Error GoTo ClicEr

C_Time = Time()

ClientMail = Forms!CustomerForm!Email
DoCmd.SendObject acSendNoObject, , , ClientMail, , , "Query Update", "Update 1", True

ClicEr:
MsgBox Err
Exit Sub

End Sub


Private Sub Combo36_Change()
On Error GoTo ClicEr2

ClientMail = Forms!CustomerForm!Email
DoCmd.SendObject acSendNoObject, , , ClientMail, , , "Query Update", "Query Update" + Combo36 + "Today", True

ClicEr2:
MsgBox Err
Exit Sub

End Sub

Private Sub Rep_Time_DblClick(Cancel As Integer)
On Error GoTo ClicEr3
Rep_Time = Time()

ClientMail = Forms!CustomerForm!Email
Custr = Forms!CustomerForm!ID
FR = Forms!CustomerForm!Faults2!FaultNo
Cat = Forms!CustomerForm!Faults2!Category
FaultRef = Str(Custr) + " / CFR" + Str(FR)
DoCmd.SendObject acSendNoObject, , , ClientMail, , , "Report", "Cat:" + Cat + "DualRef: Aqua / CNR" + FaultRef, True

ClicEr3:
MsgBox Err
Exit Sub

End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top