I'm trying to send an email for each record in a form that meets a specific criteria. The form is based on a query.
As I have it below, the VBA just processes the first record. I am aware of the For....Next, For each....Next and Do.....Loop type loops for repetitive operations, but am not sure which to use in my case.
this is what I have so far (which only processes the first record)....
thanks in advance, for any insights,
sjl
As I have it below, the VBA just processes the first record. I am aware of the For....Next, For each....Next and Do.....Loop type loops for repetitive operations, but am not sure which to use in my case.
this is what I have so far (which only processes the first record)....
Private Sub Form_Load()
Dim dtOne As Date
Dim dtDue As Date
Dim strproject As String
Dim strprotocol As String
Dim strstudymgr As String
dtOne = Date 'todays date
dtDue = Me.dtmNPacketDue
strproject = Me.strBrochureName
strprotocol = Me.strNIHProtocolNum
strstudymgr = Me.strSMName
If dtDue > dtOne Then
DoCmd.SendObject , , , "xein@mycompany.com", , , "Due Date Approaching", _
"The due date for" & strproject & ", " & strprotocol & ", is: " & dtDue _
& vbCrLf & "which is xx weeks from today. Please make a note of it." _
& vbCrLf & vbCrLf & "xxx coordinator" & vbCrLf & "Elizabeth Meng", False
End If
End Sub
Dim dtOne As Date
Dim dtDue As Date
Dim strproject As String
Dim strprotocol As String
Dim strstudymgr As String
dtOne = Date 'todays date
dtDue = Me.dtmNPacketDue
strproject = Me.strBrochureName
strprotocol = Me.strNIHProtocolNum
strstudymgr = Me.strSMName
If dtDue > dtOne Then
DoCmd.SendObject , , , "xein@mycompany.com", , , "Due Date Approaching", _
"The due date for" & strproject & ", " & strprotocol & ", is: " & dtDue _
& vbCrLf & "which is xx weeks from today. Please make a note of it." _
& vbCrLf & vbCrLf & "xxx coordinator" & vbCrLf & "Elizabeth Meng", False
End If
End Sub
thanks in advance, for any insights,
sjl