By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

DAO seems to be updating more than current record???

P: n/a
MLH
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));
May 7 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
MLH
Oops... my bad.

I see that updating the SINGLE record in tblinvoiceNums
reflects for both cars in tblVehicleJobs because those two
tables are related on the [InvoiceNumber] field. Of course,
any setting made in tblinvoiceNumswould apply to all cars
in tblVehicleJobs billed under the same invoice.
May 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.