|
-
Nov 4th, 2008, 07:23 AM
#1
Thread Starter
New Member
[RESOLVED] Access help - updating a second field automatically after inital update
Hi
I am using Access 07. I have a record which has a number of fields, what I want to do is to automatically update a second field called "last modified" which gets modified if any of the fields get modified and not on a read.
I tried attaching the following code to the Form_AfterUpdate() event
Code:
Dim db As Database
Dim qdf As DAO.QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("staffRecodUpdateTime")
qdf.Parameters("modTime").Value = Now()
qdf.Parameters("staffRef").Value = CInt([Form]![Text187].Value)
qdf.Execute dbFailOnError
qdf.Close
Set qdf = Nothing
Set dbs = Nothing
but when i exit the form I get the "write conflict - This record has been changed by another user since you started editing it..." with the three options "save record", "drop changes", "copy to clip board"
There is no other user part from myself using the database.
Is there a way to either automatically suppress the msg or committing my change regardless?
Any help appreciated!
-
Nov 4th, 2008, 08:02 AM
#2
Hyperactive Member
Re: Access help - updating a second field automatically after inital update
hi,
You could try the below
Remember to set them to true after you have closed the form.
another option would be to add a sub and setting a boolean Value to true then call the sub when a user changes a form object like a txtname_Change Event
David
-
Nov 4th, 2008, 12:22 PM
#3
Thread Starter
New Member
Re: Access help - updating a second field automatically after inital update
Cheers for that.
I also found another way:
Code:
If Me.Dirty = True Then Me.Dirty = False
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|