Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect if a record is inserted, deleted or data changed 2

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
0
0
ZA
On an Access 2000 form I need to know if:
1. a new record has been added
2. a record has been deleted
3. if any data in an existing record has been changed.

I can detect if a:
1. new record has been inserted by using the "After Insert" event
2. a record has been deleted by using the "On Delete" event

I am struggling to determine if data in an existing record has been changed. I tried using the "After Update" event. However this gets triggered after the form has opened and I simply click on a field.

What is the correct method to determine if data has been changed, bearing in mind that I also need to know if a record has been added / deleted?
 
The after update of a form shouldn't trigger just by opening it. The after update event of the form, as far as I know, triggers by a record changing in the forms recordsource, and this particular event fires after the save is changed to the recordsource.

The before update event of forms, in my eyes should give you the info you need (unless you have some saving going on that you're not aware of/is planned - which is probably the challenge you're having).

Testing for me.newrecord should give you whether it is a new record or an existing one being saved.

Roy-Vidar
 
Or you can build an Audit Log. For edited data you have there first a row before edit and another row with new data. For inserted and deleted data, there's 1 row.

Check --> it works for me!

________________
Mare [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top