Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting data changes with Form events

If you've read my other recent questions, you've prob'ly picked up that I'm not really an Access developer.... Most of my background is in VB, where I assiduously avoided bound controls.

Now I'm working in Access 2007. I have form that's based on a table (well, a single-table query), and a subform upon it based on a one-to-many child table. I want to detect user-made changes in the data on either of these forms so that I can update a date stamp in the parent table. The actual date field is not being shown to the user (at least not here).

What would be the appropriate event to catch the fact that the change has been made? How should I make the actual change (direct to form.Recordset!dateField | with a hidden bound text box | some other way)?

like image 303
RolandTumble Avatar asked Apr 27 '26 08:04

RolandTumble


1 Answers

You'll have to look for the afterupdate event, which is fired when the updated content of a bound control is updated in the underlying recordset.

In this event procedure, you should be able to write the needed instruction to update your date field. It is not necessary to have it bound to any control on the form, as long as the field is in the recordset!

like image 179
Philippe Grondier Avatar answered Apr 30 '26 00:04

Philippe Grondier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!