Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Before Update v. After Update (A97)

    We have a report generated from a table of contract proposals that includes a "status" field. This field is a memo field, and is intended to allow a paragraph or two of commentary on active proposals (just too long for a 255 character text field, unfortunately). I would like to include the date that the status commentary was last updated, so I have added a "CommentDate" field to the table, and will use either a before update or after update event on the "status" text box on the form where it is entered to change the value of the CommentDate field to the current system date. Is there any reason to prefer 'before' or 'after' update? It seems that 'before update' is better suited to data validation, but other than that are there reasons to choose one over the other?

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Before Update v. After Update (A97)

    Under normal circumstances, the AfterUpdate event is where you would place the code you talked about.

    Now, in your example, this probably won't matter. But with another situation, you might have some field validations defined in the table which are checked AFTER the BeforeUpdate event, but BEFORE the AfterUpdate. So you wouldn't want to update that date field until you KNEW that your first field had indeed been changed. This can only mean the AfterUpdate event.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Before Update v. After Update (A97)

    Okay - I see why you would prefer one over the other - if you perform some data validation and the changes are rejected, you have still fired the Before Update event and triggered whatever actions flow from that ...
    As you say, it is not a consideration in this instance, but is something to keep in mind for the future - thanks for the heads up!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •