1 2 Previous Next 21 Replies Latest reply on Jan 6, 2012 4:51 AM by Mike_Mitchell

    Help with some Logic

    arthursc

      Hello,

       

      I need some help with a bit of logic. My scenario is thus;

       

      Table A (Species) lists deer species. This is a read only table pre-populated and for this reason I do not want users to add or delete or amend this table.

       

      Table B (Culls) lists details of culls. In this table I need to list the "species" culled selected from the table above but inserted from the table below.

       

      Table C (Outings) lists outings a hunter may have done. This is where logging happens, Deer culled, sex, condition, wind direction etc.

       

      The issue I have is that As Table A is read only, I cannot add the species to Table B from a Related field in Table C.

       

      Is the best way to just created a "species_cull" table or find a better method.

       

      Kind regards

      Colin.

        • 1. Re: Help with some Logic
          usbc

          If I followed correctly, you could use Table A as a source for a value list .

           

          Chuck

          • 2. Re: Help with some Logic
            arthursc

            Hi chuck

             

            I did exactly that. Using species_id as the 1st field and then to use values from second field of species_name.

             

            Still didn't work. Unable to modify field.

             

            Sent from my iPhone

            • 3. Re: Help with some Logic
              Mike_Mitchell

              Colin -

               

              What field are you trying to modify? What table does it live in?

               

              Mike

              • 4. Re: Help with some Logic
                arthursc

                Hi Mike,

                 

                From the table outings, I wish to display fields from the species table (i.e species name) see the RG below;

                 

                BUT, I need this to work like so;

                 

                Enter ALL data in the outings table that links to the culls table, where culls are logged. This has a link to the species table as I need to log the species culled. Make sense?

                 

                Do you want access to the files?

                 

                 

                Screen Shot 2011-12-26 at 20.58.03.png

                • 5. Re: Help with some Logic
                  Mike_Mitchell

                  Colin -

                   

                  I'll ask again: What field in what table are you trying to modify when it throws the error?

                   

                  MM

                  • 6. Re: Help with some Logic
                    arthursc

                    Oh god i'm sorry i didn't read your reply correctly…

                     

                    The field I am selecting from Species tables is

                    • 7. Re: Help with some Logic
                      Mike_Mitchell

                      If the Species table is Read Only, you won't be able to modify ANY field in it.

                       

                      What are you trying to do? Associate a species with a particular Cull or Outing record? If so, then modify the foreign key for Species in that table.

                       

                      MM

                      • 8. Re: Help with some Logic
                        arthursc

                        Hey Mike.

                         

                        Essentially I am using the outings layout as a place where I can log the culls. This would be done by adding fields from the Culls table and populating those fields. The Species table only plays the role of selecting the species from the species table as a drop down list. This is so I can log the following;

                         

                        No of Deer Culled

                        Species Name

                        Sex

                        Age

                        Behaviour before cull

                        Location of cull

                         

                        I will then be able to run reports on numbers of x species culled, dates times wind directions sex….etc.

                         

                        Regards

                        Colin

                        • 9. Re: Help with some Logic
                          Mike_Mitchell

                          Given this, there should be no reason to modify the Species table. Simply place a field for Species ID in the Culls table and enter the species for each cull into it.

                           

                          MM

                          • 10. Re: Help with some Logic
                            arthursc

                            Hi Mike,

                             

                            Thats what I thought and when i attempt to use either a dropdown list or edit box I get the follwoing screen shot;

                             

                            Edit Box

                            Screen Shot 2011-12-27 at 16.43.21.png

                             

                             

                            Dropdown List

                             

                            Screen Shot 2011-12-27 at 16.50.00.png

                            • 11. Re: Help with some Logic
                              Mike_Mitchell

                              The screen shot shows the cursor in "Species Name". Is that the actual field, and does it reside in the Species table? If so, that's where your problem is coming from. If the Species table is read-only, you can't edit that field.

                               

                              If you want the user to be able to do attach a species to a Cull record, then do this:

                               

                              1) Add a Species ID field to the Culls table (which is where I assume this layout is based).

                              2) Make a value list on both Species ID and Species Name from the Species table, and hide the Species ID (i.e., show only the name).

                              3) Create a relationship from Culls to Species on Species ID.

                              4) Put the Species ID field from the Culls table AND the Species Name field from the Species table on the layout. Put the Name field ON TOP of the Species ID.

                              5) Remove the Name field from the tab order and disallow entry in Browse and Find mode.

                              6) Make the Name field a button that executes a script that puts the cursor in the Species ID field.

                              7) Attach the value list to the Species ID field.

                              8) Get rid of the arrow button to show the drop-down.

                               

                              What this will do is show just the species name on screen, but it's the name from the parent table (Species). What the user is actually editing is the ID (even though he doesn't know it).

                               

                              HTH

                               

                              Mike

                              • 12. Re: Help with some Logic
                                arthursc

                                Hi Mike

                                 

                                Apologies for taking a while to reply.

                                 

                                In answer to your suggestion please see my comments;

                                 

                                If you want the user to be able to do attach a species to a Cull record, then do this:

                                 

                                1) Add a Species ID field to the Culls table (which is where I assume this layout is based).

                                          Layout is OUTINGS

                                 

                                2) Make a value list on both Species ID and Species Name from the Species table, and hide the Species ID (i.e., show only the name).

                                          How do I hide the species ID from a value list?

                                 

                                3) Create a relationship from Culls to Species on Species ID.

                                          Already there.

                                 

                                4) Put the Species ID field from the Culls table AND the Species Name field from the Species table on the layout. Put the Name field ON TOP of the Species ID.

                                          Done

                                 

                                5) Remove the Name field from the tab order and disallow entry in Browse and Find mode.

                                          Done

                                 

                                6) Make the Name field a button that executes a script that puts the cursor in the Species ID field.

                                          DO you have a sample script that will allow me to do this

                                 

                                7) Attach the value list to the Species ID field.

                                          Not Done Yet

                                8) Get rid of the arrow button to show the drop-down.

                                           Not Done Yet

                                 

                                Regards

                                Colin

                                • 13. Re: Help with some Logic
                                  Mike_Mitchell

                                  Colin -

                                   

                                  In order to hide the first field from the value list, you choose "Show values only from second field" in the "Specify Fields for Value List" dialog:

                                   

                                  dialog.jpg

                                   

                                  I've attached a sample file that shows the technique. Look on the "ID Concealed" layout. I've left the ID field visible (i.e., text is black) so you can see the effect. In production, you would make the ID the same color as the background to conceal the fact that you're editing something other than the name.

                                   

                                  MM

                                  • 14. Re: Help with some Logic
                                    arthursc

                                    Hi Mike,

                                     

                                    Understand now fully how your doing this.

                                     

                                    I am curious as to, if this is the only way to do as I am doing, to consolidate in one layout fields from multiple tables for collation of data. Is there a more respected method that I should be using?

                                     

                                    Or if you were doing what I need to do be using the same method.

                                     

                                    Regards

                                    Colin.

                                    1 2 Previous Next