Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Unanswered: How to get name of control which changed value?


    I have a problem:

    I have number of controls on my form. If some of the controls change values, I should make a new record in table A, but if some other controls change values I should make new record in table B.

    Is there some object or parameter which stores a name of the control, that changed value?

    I know, that every control has "onChange" in "afterUpdate" event, but number of controls is large and I'm looking for the simpliest way.

    Any ideea?

  2. #2
    Join Date
    Jan 2004

    Re: How to get name of control which changed value?

    If you are using DAO

    You have the property EditMode:

    if rs.EditMode = dbEditNone then

    'No changes have been made to recordset


    'Changes have been made to recordset

    end if

    If you are using ADO

    add a WithEvents when you declare your recordset:

    Private WithEvents rs As ADODB.Recordset

    You will then get a

    RecordChangeComplete event

    Add your change code in that event
    In abundance of water only the fool is thirsty. Bob Marley.

Posting Permissions

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