Form & SubForm Event problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wquatan
    New Member
    • Oct 2007
    • 48

    Form & SubForm Event problem

    Hi

    I have a Form with a SubForm

    The Form is bound to a Query, and is used for navigation.

    In the event Form_Current there is :
    wrkField = Me!TableField
    SubForm.requery

    The SubForm is UnBound

    In the event SubForm_Current there is :
    Me.SubFormField = wrkField
    Msgbox Me.SubFormField

    I don't understand why
    - when navigating through the Query, for every occurence MsgBox is displayed twice (so SubForm_Current done twice)
    - when Form is started, MsgBox is displayed twice (without any value) and two times (with the value of the first occurence)

    Related to this, if it is possible to bind the (yet unbound controls of SubForm) to the wrkFields ? How ?

    Thanks
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by wquatan
    Hi

    I have a Form with a SubForm

    The Form is bound to a Query, and is used for navigation.

    In the event Form_Current there is :
    wrkField = Me!TableField
    SubForm.requery

    The SubForm is UnBound

    In the event SubForm_Current there is :
    Me.SubFormField = wrkField
    Msgbox Me.SubFormField

    I don't understand why
    - when navigating through the Query, for every occurence MsgBox is displayed twice (so SubForm_Current done twice)
    - when Form is started, MsgBox is displayed twice (without any value) and two times (with the value of the first occurence)

    Related to this, if it is possible to bind the (yet unbound controls of SubForm) to the wrkFields ? How ?

    Thanks
    Please forgive me, I did not quite understand what you are referring to, and I am sure you are saying what you need. Can you go into it more, precisely what you hope to achieve? Perhaps there's an idea we can refer you to.

    In a bit!

    Comment

    • wquatan
      New Member
      • Oct 2007
      • 48

      #3
      Originally posted by Dököll
      Please forgive me, I did not quite understand what you are referring to, and I am sure you are saying what you need. Can you go into it more, precisely what you hope to achieve? Perhaps there's an idea we can refer you to.

      In a bit!
      Don' know what I could tell more.

      The Form is used to allow the user to navigate through the occurences presented to him by the Query

      The SubForm (shows one occurence) is there to allow the user to do changes to the data, without immedeate commit to the table. The changes are only committed to the table after confirmation.

      Of course, the MsgBox is just there for testing-purposes, it shows that SubForm_Current get's done twice for every occurence displayed

      Comment

      • Minion
        Recognized Expert New Member
        • Dec 2007
        • 108

        #4
        I'm stumped at this point why the events would be launching twice, but I have an idea it has something to do with their relationship to one another. One of the first things I might try is putting a break in the main form and they using F8 to step through the program to see if anything jumps out to you. Sometimes it's a recursive value that calls upon itself.

        I'll keep thinking on this and post anything I can find.

        Hope this helps.

        - Minion -

        Comment

        Working...