Updating all records

wllsth

Registered User.
Local time
Today, 06:19
Joined
Sep 17, 2008
Messages
81
I have the following piece of code which runs when a user exits a particular record.

On checking the Database i find that this hasnt occurred on some occasions and my data therefore is incorrect, can someone tell me how I would run this code against ALL records in my database, as a macro perhaps ??

Private Sub cmdClose_Exit(Cancel As Integer)
TotalLabour = DLookup("[Total Billables]", "Projects Extended", "[ProjectID]=" & Nz([ID], 0))
TotalMaterials = DLookup("[Total Expenses]", "Projects Extended", "[ProjectID]=" & Nz([ID], 0))
End Sub

TotalLabour and TotalMaterials are in a table 'Projects'

Thanks
 
You're trying to store data which shouldn't be stored. This should just be able to be gathered using a query when you need those values. But they should NOT be stored in the table.
 
You're right I shouldnt be attempting this at all.
I picked up some old code.

Thanks for the help
 

Users who are viewing this thread

Back
Top Bottom