I have a query that I open the following way...
Dim MyDB As Database, MyRst As Recordset
Set MyDB = CurrentDb
Set MyRst = MyDB.OpenRecordset("qryUnpaidInvoices", dbOpenDynaset)
MyRst.MoveFirst
Need2Send = False
InvoiceDate = MyRst!InvoiceTDstamp
LastSendDate = MyRst!LastReminderDate
If DateDiff("d", LastSendDate, Now) >= 3 Then
MyRst.Edit
MyRst!LastReminderDate = Now
MyRst.Update
Need2Send = True
End If
The query rreturns 2 records. When the recordset Update executes,
it seems that both of thsoe records are being updated instead of just
the current record in DAO. I only want the first of the 2 records to
receive the new setting of Now(). Am I missing something here, or is
this strange behavior?
Here's the query...
SELECT tblVehicleJobs.InvoiceNumber, tblVehicleJobs.ProcFee,
tblinvoiceNums.InvoiceTDstamp, tblClusters.ClusterName, [VColor] & " "
& [VehicleYear] & " " & [VehicleMake] & " VIN: " & [SerialNum] & " at
" & [TowCompany] & " " & [TowCoAddr] & " " & [TowCoCity] & " VID: "
& CStr([VehicleJobID]) & " Sale Date Scheduled: " & [SaleDate] AS
Vehicle, tblinvoiceNums.LastReminderDate, tblClusters.ClusterID,
tblVehicleJobs.VehicleJobID, tblClusters.PCeMail, tblClusters.BCeMail,
SaleDate4Avehicle([VehicleJobID]) AS SaleDate
FROM tblClusters INNER JOIN (tblAdmin INNER JOIN (tblinvoiceNums INNER
JOIN tblVehicleJobs ON tblinvoiceNums.InvoiceNumber =
tblVehicleJobs.InvoiceNumber) ON tblAdmin.TowCoID =
tblVehicleJobs.TowCoID) ON tblClusters.ClusterID = tblAdmin.ClusterID
WHERE (((tblVehicleJobs.InvoiceNumber) Is Not Null) AND
((tblVehicleJobs.InvoicePaid)=False));