5 Replies Latest reply on Jan 18, 2012 12:05 PM by philmodjunk

    Populating Data from Different Tables/Fields

    KiwiKim25

      Title

      Populating Data from Different Tables/Fields

      Post

      Hello!!  I've hit a snag, and am hoping for some help!

      I have a "Behavior Table" and a "Requests Table".  In the behavior table I have a date, and a text box to enter notes.  In the Requests table I have a date and radio button options for chosing what request is made (although I might have to change that.. but that's another issue).

      What I want is, when I enter a date and request, I'd like the date/request to be entered into the behavior table (date/comments) as well, without having to go and do it manually. 

      Eventually I'd like my other tables/fields to do that as well (Social Housing History and others).

      Is this something I can accomplish with scripts (which I'm horrible at)?  I tried relating the "date"s in the relationship table, but then i end up with blanks in my Requests Table every time there is an entry on the Behavior Table.

      All the tables are related via the Animal ID Number, which is unique to each animal.

      I've included a picture to help expain better... 

      Please help!!

      Thank you!

      BehaviorLogMainScreen2012.JPG

        • 1. Re: Populating Data from Different Tables/Fields
          philmodjunk

          What relationship do you have between "behavior" and "requests"?

          With the correct relationship in place, you should not need duplicate fields in the related behavior table, you can just inlude the Date and Request fields from Requests on your layouts that are based on the Behavior table.

          • 2. Re: Populating Data from Different Tables/Fields
            KiwiKim25

            Both have a relationship with "Animal Table" (The main table I have everything layed out on) via the "Animal ID Number".  When I tried to relate the date from Behavior Table to Requests table, the requests table would show an empty field for each date there was a "Behavior Comment" entered but no request.  Is there something I missing so that it doesn't do that?

            • 3. Re: Populating Data from Different Tables/Fields
              philmodjunk

              It helps to know the tables and relationship currently in place.

              It seems you have these relationships?

              AnimalTable::AnimalID = Requests::AnimalID
              AnimalTable::AnimalID = Behavior::AnimalID

              It looks like your layout shown above is based on animalTable?

              and the portal on left is to Behavior?

              Please describe the connection between a "request" record and a "Behavior" record.

              • 4. Re: Populating Data from Different Tables/Fields
                KiwiKim25

                Yes, that's how the Animal ID relationships look, along with the portal to Behavior.

                At the moment there is no relationshop between Request and Behavior.  

                What I had tried before was BehaviorTable::Date = Requests::Date Which resulted in the extra blank fields.  Am I chosing the wrong relationship?

                • 5. Re: Populating Data from Different Tables/Fields
                  philmodjunk

                  Such a relationship would match to any pair of records with the same date, something that is unlikely to work.

                  I realize that there's no relationship. That's not really what I had in mind. If you want the data from these two fields to appear in records in both behavior and request tables, there's some sort of "connection" in how you use this data that would match request and behavior tables to each other. I'm asking for an explanation of how you use these tables in general and these two fields in specific so that I can suggest what table should define these fields and how you would then access that data from each of the other tables.

                  After taking another look at the uploaded picture of your layout, it seems you have three radio buton fields for recording info on how the animal's care.  Why would you need that data to appear in the behavior table? Why in the "request" table? What's the purpose of the date fields shown to the left of each?

                  This would seem to be info that should be kept in the animal table and layouts based on Request or behavior can simply add these fields from the animaltable to their respective layouts.

                  Either that, or you need a new table that logs current and past changes to the animal's care instructions--also related to the Animal table by animalID.