Two independent forms (non linked) to be displayed at the same time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OldDog
    New Member
    • Jun 2015
    • 3

    Two independent forms (non linked) to be displayed at the same time

    I like to display two forms in the top of each other that both linked to two different tables.
    I am wondering if something similar to split form exists. However, I need both forms to be displayed in datasheet view.
    I am staying away from sub-form(s) within main-form as my VAB code has been failing when I have sub-form instead of form.
    So how can I split the screen to two portions and display two independent forms that the user can move between the two? Or I have no choice but to use parent and sub form(s)?
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    The only other way would be to make your two forms be Popup forms. The user would then be able to position them next to each other. Personally, I would do the subform method and have them set as Continuous Form, not datasheet, but that is up to you.

    Here is a link for how to reference controls on subforms.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32662

      #3
      I'm not sure you'll get too far trying to have two pop-up forms run simultaneously. A pop-up form acts like a dialog box and disallows code from anything but itself to run until it's closed.

      That said, I see no reason why two independent forms should not co-exist side-by-side on the screen as long as they aren't pop-up.

      How you arrange them can be clumsy or precise depending on how much VBA you want to use, but the idea of them running together shouldn't be a problem.

      You mention you want one on top of the other. That could work, but having them side-by-side makes more sense to me. I'm not sitting at your desk though ;-) What works best for you?

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        @NeoPa, I have used popup forms without having them be modal, and code continues to run on the calling form at least, so I'm not sure what you mean by a popup form acts like a dialog box. Does it limit it to just the calling form?

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32662

          #5
          No Seth. You're right. I was mistaken. I was thinking of modal rather than pop-up.

          Comment

          • OldDog
            New Member
            • Jun 2015
            • 3

            #6
            @NeoPa
            Sorry for the confusion, I meant to say or should have said "adjacent to each other";(one at upper part of the screen, and one in the lower part of the screen). I will be using the upper form for the user to enter parts and filter on the entries to select parts quickly from a huge database that has over 10,000 record in the lower form.
            I will be reading what Seth recommended in his response..
            However, before I go further, fundamentally, I am assuming that I should be able to utilize my "filter" that I build using VBA code that is working with form alone now. My plan is utilize the filter – with some modification- when I go to utilize sub-form. Am I safe going that route? If so, what should be my syntax when utilizing a defined "filter" from multiple fields and calling a sub-form?

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32662

              #7
              Let me know if I'm mistaken, but I'm going to assume that when you refer tou your sub-form, you're really talking about the other, independent, form on screen together at the same time.

              There is no reason why a filter applied to, or determined from, one form cannot be applied to the other. Keeping them in synch or driving one from the selections on another is perfectly feasible.

              When creating a string to apply as a filter that covers multiple items (IE. Field1 must be 'XXX' as well as Field2 being 'YYY'.) you simply include all the items and the values in a string separated by the word AND. EG. For the criteria above the SQL string would look like :
              Code:
              ([Field1]='XXX') AND ([Field2]='YYY')
              A third field (Numeric this time and matching 32.5.) can be added as :
              Code:
              ([Field1]='XXX') AND ([Field2]='YYY') AND ([Field3]=32.5)

              Comment

              • OldDog
                New Member
                • Jun 2015
                • 3

                #8
                Managed to get it working. Thanks; I Had some syntax difficulties but I am all set.. At least for now.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32662

                  #9
                  Great to hear. Well done.

                  In case it's helpful, Example Filtering on a Form gives lots of info on form filtering.

                  Comment

                  Working...