Date Changin In VB (PLEASE HELP)

Silverblood

Registered User.
Local time
Today, 18:09
Joined
Aug 4, 2005
Messages
39
I have a problem in Access. In my form records there's a date which says when it's last updated, i need to do that manually, now i want to make access do that automaticly. the code i have atm is :
Private Sub Mutatiedatum_AfterUpdate()

UPDATE
SET lastUpdate=NOW()

End Sub
but that doesn't work
Can Some1 please help me with this?

SilverBlood
There's Nothing To Fear But Fear Itself
 
Use the form's BeforeUpdate event to set the date/time of your last modified field for the current record.
 
I tried that but it did't work.. i think i did something wrong then. can u give me the VB code to Do it?
 
From the UPDATE you supplied (given you are doing all the ADO or DAO stuff properly) it would update all the rows in the table since there is no WHERE clause to specify a certain row or rows. But I suspect you are not setting up your ADO connection and executing the SQL or using the DOCMD execute SQL method at least from supplied example.
 
Silver,

Use the BeforeUpdate like ghudson said and put:

Me.lastUpdate = NOW()

Wayne
 
I'm a noob in access so i don't get the AOD and DOA stuff can some1 please explain what i'm doing wrong and how to fix it?
 
If this Last Update date is in your table. The easiest way might be to create a invisable field (or visable depending if you want to show it or not) and then in the beforeupdate event just set the value of that form field to the current date/time. Just use the code WayneRyan had in his post in an event procedure.
 

Users who are viewing this thread

Back
Top Bottom