Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2006
    Posts
    157

    Exclamation Unanswered: subform triggering parent form on dirty event

    I'm having trouble trying to reference a main form's on dirty event from a subform's own on dirty event.

    It seems quite peculiar, I feel that it's just a logical derivative of having subforms on forms that there should be some kind of subform method that trigger's the parent's own events.

    I've tried using a global boolean variable that should tell the form's on current to trigger the main form's on dirty event,

    but this is just one more goto type of strategy that I wish to avoid.

    been searching around and still found no direct answer to this rather inevitable question

    thanks in advance,

    syntaxerror
    Only quitters quit!

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    If you want to fire the Dirty event on what you call the Main Form (which would actually be the Parent Form) and you want to do it from the Dirty event in your Sub-Form located in that Parent Form then this is what you will need to do:

    Change the declarationIn the Parent Form's OnDirty event code declaration, change the Private to Public so that it reads:

    Public Sub Form_Dirty(Cancel As Integer)
    MsgBox "Main Dirty"
    End Sub

    Then in the OnDirty event for your SubForm, you can fire the Dirty event of the Parent Form like this:

    Call Me.Parent.Form_Dirty(0)


    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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