MsAccess 2007 Strange behaviour

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marc Haazen
    New Member
    • Nov 2011
    • 2

    #1

    MsAccess 2007 Strange behaviour

    Hi all,

    I developed an application where within one main form 3 subforms are used. 1. Documents, 2. Items within a document, 3. optional Table data if the item represents a table type item. All this is conducted by meta data determining what items should be loaded when a document is created or selected. There is no parent child relation defined between any of the forms/subforms.
    The app is used by 80 to 100 users.
    For 6 years everything went well.
    Since migrated to win7 office 2007, a strange non debuggeable behaviour occurs. When the users switches between a table type item A and another B, as expected each time he clicks on A or B, the 3rd subform shows the data and structure of the related table data as defined by the meta data. When the user clicks inside the 3rd subform, focus is set to the content of that table. Until suddenly, after several switches between table A and B, and clicking again in the 3rd subform, subform 2 triggers, out of the blue, a form.current back to the previously selected table item. When debugging there appears to be no code execution preceding this event. Hence, I have no clou where it comes from. I already checked the app code on simultanious conflicting data access through forms and recordsets. Dirty status is used to avoid pending status of data. I also checked on possible conflicts in naming of public functions and subs, global variables etc. Decompiling, rebuilding by import into a fresh db etc did not resolve the problem.
    Does anyone know about something similar related to MsAccess 2007 itself or service packs?
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Hi Marc,

    It's not the code, but the sequence of the form events that's changed in A2007. Had to change some of my Access applications too to get them working as designed in A2003.

    Would advise you to start using (hidden) fields on the form to link the three subforms, thus making it "event undependent".

    This works by setting the value of a (hidden) keyfield in the OnCurrent event of the subform and linking the other subform to that filled (hidden) keyfield in the linkage fields of the other subform.

    Getting the idea ?

    Nic;o)

    Comment

    • Marc Haazen
      New Member
      • Nov 2011
      • 2

      #3
      Hi Nico,

      Thx for the fast reply. I will look into it asap.
      I suppose you mean that I should simulate the current event and thus avoid it?
      As I understand, the event of subform A sets a field on the main form which in turn triggers an event on the second subform B. That means that the subform should be polling for a change in the timer event?

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Try to avoid use of the timer, it messes up things...

        The process in steps:
        1) Place the unique ID of subform1 on the main form and fill it in the Subform1.OnCurr ent.
        2) Arrange the linkage fields of subform2 to be linked to this unique ID of subform1
        3) Place the unique ID of subform2 on the main form and fill it in the Subform2.OnCurr ent.
        4) Arrange the linkage fields of subform3 to be linked to this unique ID of subform2

        This should be all. Now only the OnCurrent is used and no other form events can mess up things.

        Nic;o)

        Comment

        Working...