Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #10967

Re: Auto Update Column on Record Update

From Ulrich Möller <knobbi38@arcor.de>
Newsgroups comp.databases.ms-access
Subject Re: Auto Update Column on Record Update
Date 2015-07-28 18:53 +0200
Organization A noiseless patient Spider
Message-ID <mp8bub$6hk$1@dont-email.me> (permalink)
References <b56e5c5b-6da2-4b19-a012-2267f4160690@googlegroups.com> <mp5963$nud$1@dont-email.me> <44c0029f-66d3-4ad3-997a-0c0ec0f9060d@googlegroups.com>

Show all headers | View raw


Am 28.07.2015 um 18:15 schrieb mflynn@scu.edu:
> Thanks all of you.  In forms I do have
> code in the AfterUpdate event to set the UpdateDate to Now().
> What I was looking for was more Ron's suggestion of something in the backend that runs whenever a record is updated, but I don't know how to do that.
>
> In my setup there's just a front and backend combined, a normal Access .accdb file with the menus, code and data all together.  There's no separate backend, such as SQL Server.
>
>
>
Hi Mike,

it is better to use the beforeupdate form event instead of the 
afterupdate event. The afterupdate event is raised when the record has 
been already updated in the table so you would cause the application to 
make an update twice only for the timestamp.

To generalize this, you could create a class which catches the form 
beforeupdate event and makes the modifications to the underling form 
recordset. Then you will be able to use this class in all your forms. 
After that code changes are only needed to be done in this separate 
single class module.

Ulrich

Back to comp.databases.ms-access | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Auto Update Column on Record Update mflynn@scu.edu - 2015-07-23 11:47 -0700
  Re: Auto Update Column on Record Update Patrick Finucane <patrickfinucanetx@gmail.com> - 2015-07-24 06:09 -0700
    Re: Auto Update Column on Record Update Ulrich Möller <knobbi38@arcor.de> - 2015-07-24 22:00 +0200
  Re: Auto Update Column on Record Update "Ron Paii" <None@none.com> - 2015-07-27 07:47 -0500
    Re: Auto Update Column on Record Update mflynn@scu.edu - 2015-07-28 09:15 -0700
      Re: Auto Update Column on Record Update Ulrich Möller <knobbi38@arcor.de> - 2015-07-28 18:53 +0200
      Re: Auto Update Column on Record Update "Ron Paii" <None@none.com> - 2015-07-29 07:59 -0500
        Re: Auto Update Column on Record Update mflynn@scu.edu - 2015-07-30 09:16 -0700

csiph-web