I have a formula in a subform (also have the same formula in the main form) that counts how many boxes are checked in the Rerun column.
It will only calculate the total if I toggle the record forward and back on the main form.
How do I get that to calculate in real time?
I'd like to send an email from outlook when the count is greater than zero.
I have a field called RerunTorF that changes to a 1 when the count goes over zero.
The email does not trigger (I have checked the box to turn on Microsoft outlook 16.0 Object Library) . I've shown the code below:
Private Sub RerunTorF_Change()
Dim Msg As String
Msg = "All" & ",<P>" & _
"Heat treat line " & HeatTreatLine & " has parts that have been rerun. Please inspect for quality."
Dim O As Outlook.Application
Dim M As Outlook.MailItem
Set O = New Outlook.Application
Set M = O.CreateItem(olMailItem)
With M
.BodyFormat = olFormatHTML
.HTMLBody = "Msg"
.To "jlindquist@whirltronics.com"
.Subject = "HEAT TREAT LINE RERUNS " & Now()
.Send 'If you want it to send immediately
End With
Set M = Nothing
Set O = Nothing
End Sub