I
ifoundgoldbug
This is the code that I am running at form load to check the last time
an e-mail was sent VS the current date and if it is over a week old or
if it monday to send off an e-mail. but every time it runs sucessfully
one time for some reason it wipes my EOF and BOF data any help would be
appreciated.
<code>
Private Sub Form_Load()
Dim saveme As Boolean
Dim LastDate As Date
Dim today As Date
Dim rs As ADODB.Recordset
today = Date
Set rs = New ADODB.Recordset
rs.Open "SELECT pmtable.EmailDate FROM pmtable WHERE
(((pmtable.EmailDate)<Date()))", _
CurrentProject.Connection, adOpenForwardOnly,
adLockOptimistic
LastDate = rs.Fields.Item(0)
If (today - LastDate) > 6 Or Weekday(today) = vbMonday And Not
today = lastday Then
saveme = True
Call SendNotesMail("test", "", "(e-mail address removed)", "this is
a test of the automatic PM system", saveme)
rs.Fields.Item(0) = Date
End If
rs.UpdateBatch
rs.Close
Set rs = Nothing
End Sub
</code>
an e-mail was sent VS the current date and if it is over a week old or
if it monday to send off an e-mail. but every time it runs sucessfully
one time for some reason it wipes my EOF and BOF data any help would be
appreciated.
<code>
Private Sub Form_Load()
Dim saveme As Boolean
Dim LastDate As Date
Dim today As Date
Dim rs As ADODB.Recordset
today = Date
Set rs = New ADODB.Recordset
rs.Open "SELECT pmtable.EmailDate FROM pmtable WHERE
(((pmtable.EmailDate)<Date()))", _
CurrentProject.Connection, adOpenForwardOnly,
adLockOptimistic
LastDate = rs.Fields.Item(0)
If (today - LastDate) > 6 Or Weekday(today) = vbMonday And Not
today = lastday Then
saveme = True
Call SendNotesMail("test", "", "(e-mail address removed)", "this is
a test of the automatic PM system", saveme)
rs.Fields.Item(0) = Date
End If
rs.UpdateBatch
rs.Close
Set rs = Nothing
End Sub
</code>