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
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