3 Replies Latest reply on Sep 24, 2013 10:04 PM by philmodjunk

    Select a Name on a dropdown list and populate (display) the other fields with info.

    bvillarreal

      Title

      Select a Name on a dropdown list and populate (display) the other fields with info.

      Post


           I am having some trouble.. getting this to work.. It's probably something simple but I can't get it to work. 

           Problem: I have a field that is a drop down list to select Teacher Names.. When I select a teacher name, i want the other fields to show the correct information of that teacher like email and subject.

           I have two table (Teacher info) and (Teacher Subject).. Relationship link on Teacher info: id and Teacher subject: id

           So when I select a teacher, the information does not show up.. I looked up on youtube but nothing.. Any help.. thanks..

           if I click on next record the information shows up but I select a teacher name that other fields stay the same.

           I created a simple database but can get it.. look at the image below..

      Screen_Shot_2013-09-24_at_9.49.57_PM.png

        • 1. Re: Select a Name on a dropdown list and populate (display) the other fields with info.
          philmodjunk

               I must assume that the layout is based on teacher, not teacher subject.

               FullName should not be formatted as a drop down list. id should be formatted with a value list that enters the Teacher ID. A value list can be set up for this that lists ID as field 1 and the teacher's name as field 2. This allows you to select the teacher by name, but the value list enters the teacher's ID.

               But shouldn't the layout be based on teacher subject rather than teacher?

          • 2. Re: Select a Name on a dropdown list and populate (display) the other fields with info.
            bvillarreal

                 Should I create two tables or only one?  if I create One table with ID, fullname,subject and email address.  but I want to have a list of all teachers already in the database where someone can select a teacher name using the dropdown list and their email will show up.  that is where I am having trouble.  I don't want to enter any information. All teachers information is already imported.

                  

                 any examples...

            • 3. Re: Select a Name on a dropdown list and populate (display) the other fields with info.
              philmodjunk

                   What are you trying to do with this data? Do you even need two tables?

                   Does a teacher teach one subject or many?

                   Assuming that a given teacher teaches many subjects, you should have two tables linked in a one to many relationship:

                   Teachers-----<Teacher Subject

                   Teachers::__pkTeacherID = Teacher Subject::_fkTeacherID

                   But in the layout shown, are you trying to create a new subject record or a teacher record? a drop down list of teachers does not make sense for making a new record in the Teachers table as you would be entering a name that does not appear in the list for each new record. It may be of use on a layout for creating new Teacher Subject records though I can think of other layouts--such as a portal to Teacher Subject placed on the Teachers layout, that would not use any drop down list of Teachers.