Robin-
That code goes in the Form's BeforeUpdate event, and you don't need to do the test for Me.Dirty because it's guaranteed to be True if you're in the BeforeUpdate event.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
On Feb 11, 2015, at 2:06 AM, Robin Chapple robinski@westnet.com.au [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I have a table with a "LastUpdated" field which is planned to carry
the date that changes were made. If the record is viewed the field
should not be changed.
About ten years ago I had advice for a similar problem from which I
have made this code:
If Me.Dirty = True Then "lastUpdate = Date()
The question is where do I add the code?
My attempt failed:
Private Sub Form_AfterUpdate()
If Me.Dirty = True Then "lastUpdate" = Date()
End Sub
Many thanks,
Robin Chapple
------------------------------------
Posted by: Robin Chapple <robinski@westnet.com.au>
------------------------------------
------------------------------------
Yahoo Groups Links
Posted by: John Viescas <johnv@msn.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar