2 tables shown on 1 form??!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IP This
    New Member
    • Jul 2007
    • 8

    2 tables shown on 1 form??!!

    OK, not the most knowledgable, but here i go...

    I am developing a database with two seperate tables (tbl_london and tbl_bristol),

    I would like to display all information from both tables (both with the exact same fields) on 1 form in "Default View: Continuous Forms" view. Is this possible to do in continuous form view, also i don't want to use subforms either.

    I know it may be possible using an "On Open" search query perhaps, but not sure the best way to go about it.

    Any tips would be very helpful in my quest to be a true ms access expert, as well as not get fired.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by IP This
    OK, not the most knowledgable, but here i go...

    I am developing a database with two seperate tables (tbl_london and tbl_bristol),

    I would like to display all information from both tables (both with the exact same fields) on 1 form in "Default View: Continuous Forms" view. Is this possible to do in continuous form view, also i don't want to use subforms either.

    I know it may be possible using an "On Open" search query perhaps, but not sure the best way to go about it.

    Any tips would be very helpful in my quest to be a true ms access expert, as well as not get fired.
    Two very noble quests indeed. Unfortunately you had posted this in the wrong forum(MySQL) so I've moved it to the Access forum.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Originally posted by IP This
      OK, not the most knowledgable, but here i go...

      I am developing a database with two seperate tables (tbl_london and tbl_bristol),

      I would like to display all information from both tables (both with the exact same fields) on 1 form in "Default View: Continuous Forms" view. Is this possible to do in continuous form view, also i don't want to use subforms either.

      I know it may be possible using an "On Open" search query perhaps, but not sure the best way to go about it.

      Any tips would be very helpful in my quest to be a true ms access expert, as well as not get fired.
      Why don't you want to use subforms?

      If the tables are related in some way you can join them, if they have the same fields you can union them.

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        If they both have the same fields you could try creating a UNION query. This will join both into one. This query would then be the recordsource for your form and you could view the data from both tables as if they were one.

        Here's an example of a UNION query:

        [code=sql]
        SELECT managerFirstNam e, managerLastName , managerAddress
        FROM tblManager
        UNION
        Select employeeFirstNa me, employeeLastNam e, employeeAddress
        FROM tblEmployee
        [/code]

        Let me know how this works out for you.

        Edit: Must have been mid-post while you posted there Rabbit. Nice to see we're both on the same track though :)

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          Hmm, I wonder if Union Queries are updateable though. It wouldn't know which table to put the record in. May have toss in a create table statement in there if you want to add records. And with a Join not all the fields are updateable.

          Comment

          • JKing
            Recognized Expert Top Contributor
            • Jun 2007
            • 1206

            #6
            If the form is for view-only purposes the Union query would be just fine.

            Comment

            • IP This
              New Member
              • Jul 2007
              • 8

              #7
              Thanks very much for the reply's... seems quite hard to get the specifications i want using access... the union query seems the best one, but having trouble implementing it, as well as the possibility of not being able to update!

              I didn't want to use subforms as i want there to be a button next to each record (form in countinuous view) so people can click onto another form displaying the rest of the information for that record. (however i may be wrong in assuming i can't link to other forms by clicking onto the particular record your interested in within the subform format???)

              Very much open to suggestions if anyone has an answer to this enigma... let me know if you need more details.

              Cheers.

              Comment

              • IP This
                New Member
                • Jul 2007
                • 8

                #8
                ok, union query works very good, the exact look i'm after... just the link onto the form containing the rest of THAT records fields... it comes up with the message:

                "The command or action SaveRecord isn't available right now"

                Tried taking out the save command from the macro but stops working completely... so it's just the last part in having a link onto other forms from the particular record?!?!?

                Graciarse

                Comment

                • IP This
                  New Member
                  • Jul 2007
                  • 8

                  #9
                  ok, union query works very good, the exact look i'm after... just the link onto the form containing the rest of THAT records fields... it comes up with the message:

                  "The command or action SaveRecord isn't available right now"

                  Tried taking out the save command from the macro but stops working completely... so it's just the last part in having a link onto other forms from the particular record?!?!?

                  Graciarse

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    A union query is not updateable. It has no idea which table to update. You'll have to make a table from the union query and update to that table. This means that your two original tables become outdated.

                    Comment

                    Working...