Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    1

    Unanswered: Form_OnDirty Event Question

    In my Access 2000 Form_OnDirty event, a control’s value is to be changed using code. However, when the control’s value is to be changed, the Form_OnDirty event is re-triggered. The result is an infinite loop.

    Here is the code:
    ‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ ’’’’’’’’’’’’’’’’’’’’
    ‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ ’’’’’’’’’’’’’’’’’’’’
    Private Sub Form_Dirty(Cancel As Integer)

    ‘error handler
    On Error GoTo ErrorHandler

    lstAuthorizedEntryPerson.Value = CurrentUser()

    Exit Sub

    ErrorHandler:
    MsgBox (Err.Number & " " & Err.Description), vbOKOnly, TITLE
    End Sub
    ‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ ’’’’’’’’’’’’’’’’’’’’
    ‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ ’’’’’’’’’’’’’’’’’’’’

    Would someone please respond how to change the control’s value without re-triggering the Form_OnDirty event?

    Thank you for your consideration,
    Jaisontmain

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    Move your code from on dirty to after update and after insert

Posting Permissions

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