Pulling data across multiple forms in Access 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Himmel
    New Member
    • Apr 2007
    • 21

    Pulling data across multiple forms in Access 2003

    Hello,

    I have a database form that has a tabs control, and on each tab is another form. Each form pulls data from a different query.

    For example, tab 1 may list personal information (form1), tab 2 shows billing information (form2).

    I have a rather simple problem, but I can't seem to figure out how to pull data from the form on tab 2 and display it on tab 1. So if the form2 on tab 2 has a field called "balanceDue ", I'd like to assign a field on form1 to show that information.

    To check that I am able to get the data from form2 on form1, I've tried making a very simple button that does "msgbox(form2!b alanceDue.value )" but that clearly does not work.

    I feel like a noob. Could someone help me? :-)
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    form1 and form2 are considered subforms of the main form.
    Create a textbox on subform1 and set the value to
    Code:
    =Forms![MainFormName]![subform2name].Form![balanceDue]
    Mary

    Comment

    • Himmel
      New Member
      • Apr 2007
      • 21

      #3
      Originally posted by mmccarthy
      form1 and form2 are considered subforms of the main form.
      Create a textbox on subform1 and set the value to
      Code:
      =Forms![MainFormName]![subform2name].Form![balanceDue]
      Mary

      Thanks Mary,

      Yup just figured this out myself, about 10 seconds ago. lol.

      I was trying to derive the proper object properties. My ! and . and syntax were tripping over each other. haha.

      "msgbox(Forms!m ainform.form2!b alanceDue.Value )" did the trick. I can stop bashing my head into the table now. haha

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by Himmel
        Thanks Mary,

        Yup just figured this out myself, about 10 seconds ago. lol.

        I was trying to derive the proper object properties. My ! and . and syntax were tripping over each other. haha.

        "msgbox(Forms!m ainform.form2!b alanceDue.Value )" did the trick. I can stop bashing my head into the table now. haha
        Glad you got it sorted. It's always nice when you can figure these things out for yourself.

        Comment

        • Himmel
          New Member
          • Apr 2007
          • 21

          #5
          Originally posted by Himmel
          Thanks Mary,

          Yup just figured this out myself, about 10 seconds ago. lol.

          I was trying to derive the proper object properties. My ! and . and syntax were tripping over each other. haha.

          "msgbox(Forms!m ainform.form2!b alanceDue.Value )" did the trick. I can stop bashing my head into the table now. haha
          Actually, I tried this in a test form (parent form with two child forms on it) and it worked fine. However, on the live form (using tabs control) it does not work.

          I get "Applicatio n-defined or Object-defined error"

          Comment

          • Himmel
            New Member
            • Apr 2007
            • 21

            #6
            Yeah, appears to be a problem with having a tabs control. Do I need to refer to the tabs control and/or tab the second form is on?

            I'm confusing even myself, so hopefully a screenshot will help illustrate this. :)


            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Go back to the syntax I gave you originally, look at the .Form bit. Also check the name of the subform object as opposed to the subform. If you click on the frame around the subform in design view and open the properties window. Under the Other tab check the value in the Name property.

              Comment

              • Himmel
                New Member
                • Apr 2007
                • 21

                #8
                How did you know? :-)


                A million thanks. Good god I've been staring at this thing waaaay too long.

                Comment

                • MMcCarthy
                  Recognized Expert MVP
                  • Aug 2006
                  • 14387

                  #9
                  Originally posted by Himmel
                  How did you know? :-)


                  A million thanks. Good god I've been staring at this thing waaaay too long.
                  Been caught out on that one a few times myself :)

                  Glad to help.

                  Comment

                  • kartikss
                    New Member
                    • Apr 2007
                    • 25

                    #10
                    Hi!!!!

                    There are 2 options to work on it.

                    Option 1

                    1. Create a query by selecting 2 or more table in 1 query.
                    2. Select the fields in query as per your requirement.
                    3. After saving the query , then create a form
                    4. Select the tab option in form
                    5

                    Comment

                    • kartikss
                      New Member
                      • Apr 2007
                      • 25

                      #11
                      kindly inform previous message send by me

                      Hi!!!!

                      There are 2 options to work on it.

                      Option 1

                      1. Create a query by selecting 2 or more table in 1 query.
                      2. Select the fields in query as per your requirement.
                      3. After saving the query , then create a form
                      4. Select the tab option in form
                      5. Select the fields (created in query) in tab 1 and go to tab 2 select the fields from same query (having 2nd table). and disable those fields

                      Option 2

                      1. Select the fields from table 1 in tab 1
                      2. Go to tab 2 and unbound text field option and type the field name and disable that option.

                      try this options , still if you feel confusing do let me know.


                      Thanks & Bye

                      Kartik

                      Comment

                      Working...