Module level variable not holding its value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • topher23
    Recognized Expert New Member
    • Oct 2008
    • 234

    #16
    Since a splitform does, in effect, create two instances of a form, it's probable that an object module-level variable would never work. If you don't want to explicitly use a global variable, perhaps a TempVar which is created when you need it and removed as soon as you don't would strike your fancy. With that, you could bypass OpenArgs altogether.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32634

      #17
      That makes sense. It probably means that even a Public defined variable wouldn't be adequate to your needs. Try it first though, anyway.

      Otherwise, Topher's suggestion of TempVars sounds like a good solution. It's a shame, as it helps (with maintenance etc.) to have variables related to an object and its work be stored within the design of the object itself rather than elsewhere.

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #18
        Okay, finally got back to this project. Public didn't help anything, so I'm going with the global variable declared in a separate module.

        You would think that Microsoft would provide a way to reference the correct instance of the form when using split forms.

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #19
          agreed.

          Guess what I found here on Bytes: http://bytes.com/topic/access/answer...-access-2007-a
          Appears that this isn't the first time this shows up.

          It would seem to me that if there are two instances then in the forms collection both should be visible, something to try. Wish I had time to play with that concept today howver, we've lost another in the lab; thus, I'm now wearing 5 hats.
          :(

          Comment

          Working...