9 Replies Latest reply on May 1, 2009 2:57 PM by ekm12

    Value List from a subset of data

    ekm12

      Title

      Value List from a subset of data

      Post

      Hello,

       

      Is there anyone who might know how I can create a Radio Button Value List from a subset of data from a table?

       

      I have a layout I'd like to display a subset of student names for a specific campus using Radio Buttons.  Today the users edit the Value list and adds the student name to the list, I was hoping to have the list come from the Student DB where the data is current and more accurate.  This layout is only used by the specific campus.

       

      There are a few combinations I tried using related tables and I get all students or just one student, I'm stumped... 

       

      Thanking you in advance...  :) 

       

       

        • 1. Re: Value List from a subset of data
          philmodjunk
            

          It's all in how you define your relationships. Check the following thread and see if it explains things well enough for you to get it to work. This thread talks about using a drop down menu, but the prinicple is the same:

           

          Create COMBO BOX linked

          • 2. Re: Value List from a subset of data
            ekm12
              

            Thank you for the reply.  I did review the thread you mentioned and gave it a try, this does not work for me, I believe what I'm looking for should be easy but I'm not getting it.

             

            Main database StudentDB with a calculated field WaldenStudents, If (Campus = "Walden"; "Walden; "" )

            Created Related table using ++  Check4WaldenStudents

            Created Relationship using StudentDB::Campus = Check4WaldenStudents::WaldenStudents

            Created a value list WaldenStudents with values from StudentDB::Name

                       and "Include only related values starting from:" related table Check4WaldenStudents

            With this combination, I get Alll students from the database. 

             

            If you can redirect me, this will be greatly appreciated... thank you

             

             

             

            • 3. Re: Value List from a subset of data
              philmodjunk
                

              I got this to work for me following your directions.

              The underlying layout table was StudentDB

              I only got Walden students if the current record was a Walden student, If I tested the value list from a Non-walden record, I got an empty value list--which is the expected result from your example.

               

              What field did you format with the value list?

              What table is selected for the layout where you put the formatted field?

              Does your calculation return text or "number"?

               

              I wouldn't use a calculated key like you've set up. It'll only work for Walden students and you'd have to set up separate keys and relationships for every campus. If you have more than one or two campus names and/or you need to add/remove campus names, you'll have to do a lot of design work for each change.

               

              Exactly how I'd change that, depends on what you need to do.

               

               

              • 4. Re: Value List from a subset of data
                ekm12
                   <!--  StartFragment  -->

                I got this to work for me following your directions.

                The underlying layout table was StudentDB

                         Yes, my underlying table is StudentDB for the layout

                 

                I only got Walden students if the current record was a Walden student, If Itested the value list from a Non-walden record, I got an empty valuelist--which is the expected result from your example.

                         I don't understand how you managed to get just the one, Iget all students from the database 

                 

                Whatfield did you format with the value list?

                         Student Name (text) from the StudentDB 

                 

                Whattable is selected for the layout where you put the formatted field?

                         StudentDB

                 

                Doesyour calculation return text or "number"?

                         It returns all the student names from the StudentDB 

                 

                I wouldn't use a calculated key like you've set up. It'll only work for Waldenstudents and you'd have to set up separate keys and relationships for everycampus. If you have more than one or two campus names and/or you need toadd/remove campus names, you'll have to do a lot of design work for eachchange.

                         I don't understand why this would be a lot of work andI'm sure that's because I don't understand the solution... 

                 

                Exactlyhow I'd change that, depends on what you need to do.

                       The request is to have a subset list of students displayed in a layout with theRadio Buttons, once a user chooses the student; there is a button to process ascript where the user will go to another layout to change the data for thespecific student.  Today, the user manages the Value List of students; we are trying to automate the list by retrieving the data from theStudentDB.   

                <!--  EndFragment  -->
                • 5. Re: Value List from a subset of data
                  philmodjunk
                    

                  Obviously, something is different between your database and mine and we can't spot the differences by describing it in text. All I can tell you is that it should work. I've even tried to break this several different ways and can't get "all names". I'd double check your value list definition and make sure that your field/control setup is referencing the value list you think you have.

                   

                  I have a demo file you can examine. Send me a private message with your email address and I'll send it to you.

                  • 6. Re: Value List from a subset of data
                    ekm12
                      

                    I don't know how to send you my email address because I don't know yours...

                     

                    I would love to have the demo. 

                    • 7. Re: Value List from a subset of data
                      philmodjunk
                        

                      I've sent you a private message with my email address. Click the envelope icon in the upper right corner of your screen.

                      • 8. Re: Value List from a subset of data
                        philmodjunk
                          

                        I've sent you a demo file. I included two methods for doing what you want. The first method replicates the steps you used at the beginning of this thread. I've included a second approach that may be more flexible.

                         

                        In my demo file, you can format the Student name field with either value list if you choose. I've chosen to format separate global fields simply for demonstration purposes.

                         

                        Method 1 shows "no values defined" in every case where the current record is not a "Walden" student. If you want to see a similar list of students from another campus, you will have to create another calculation field, another related table occurrence and another value list.

                         

                        Method 2 shows all students that are from the campus whose name you select from a drop down menu immediately above the radio button formatted field. If you add student records who are assigned to additional campuses, no additional changes are needed, the new campus names will appear in the drop down menu automatically and member student names will show listed in the field below when you select the new campus in the drop down menu.

                         

                        Method 2 is based on a different design. The global field "gSelectedCampus" is used in a self join that links to a table occurrence named "SelectedCampus". The gSelectedCampus field is formatted as a drop down list that shows all campus names. A different global text field, gStudent 2, is formatted with a new value list, "StudentsByCampus" which lists all student names from the SelectedCampus table occurrence and specifies "Only related values starting from CampusTest." (CampusTest is my main table.)

                           

                        Given the potentially long list of names, I'd consider formatting the fields as drop down lists with the auto-complete option enabled instead of using radio buttons.

                        • 9. Re: Value List from a subset of data
                          ekm12
                            

                          Yes, this solution worked... Thank you! 

                           

                          Also, I would like to thank you for sharing your design idea; I did manage to incorporate the design into my solution.

                           

                          Appreciatively,

                          ekm12