Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    28

    Unanswered: Forms : On Change Event Procedure

    My table X has a field “DateLastUpdated”, along with 7 other fields.
    Within my Form, I wish to set this field to today’s date whenever any of the 7 others change.
    To do this, I suspect I can set an ‘On Change’[Event Procedure] for each of the 7, but is there a better way of doing this ?

    And can you suggest what the vb coding might be, as I am a complete novice.

    This field should also be set when a new record is written to table X.

    Many thanks

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Presuming the form is bound to the table, try the before (or after) update event of the form. It will fire when any value is changed.

    Me.ControlName = Date()
    Paul

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Paul's solution is correct, of course, for this scenario. But FYI, there are very few situations where using the OnChange event is appropriate. When entering data in a textbox or combobox, the OnChange event fires each time a character is entered! Actions based on the entering/changing of data in a control are usually executed in that control's AfterUpdate event.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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