3 Replies Latest reply on Jan 14, 2009 2:43 PM by raybaudi

    2 beginner questions -- drop-down lists

    jimd

      Title

      2 beginner questions -- drop-down lists & record number

      Post

      I am creating a database with about 10 fields in it for research through multiple books in three different areas and I don't know how to do the following:

       

      1. There is a field called Area with three checkbox choices in it: "Brecht" "Jazz" or "Mime".  Based on the selection in that field, I would like another field (entitled "Record No.") to autofill with a corresponding "B" "J" or "M" followed by a number, which corresponds to record number in that category.  That is, when I create a new record and then select "Mime" (in the Area category) for example, and it's the 42nd time I've created a record with "Mime" selected in the Area field, then I would like the "Record No." field to automatically fill itself with "M42".  Is this possible?  How would I do it?  I've never used a script before and don't really know how.  Would one of these help?

       

      2. I have a dropdown menu (for a field entitled "keywords" with a value list that keeps updating itself based on values that I put in that field on other records.  It works. But I want to be able to select more than one item from the list.  The help manual says to use a checkbox instead but I expect to have  around a hundred different values (keywords) as options on the menu so a checkbox won't work.  Is there a way to have a field that lets me either write in my own word OR pick from any of the values already created for the field AND be able to select more than one.  I would like to be able to select up to about 10 different keywords from a possible hundred or so and have all 10 show up in the field for that record.  Help?

        • 1. Re: 2 beginner questions -- drop-down lists & record number
          ninja
            

          G'mornin' jimd,

          Thanks for the post.

           

          Question 1 first...Yes it's possible and Yes you'll want to use a script.

          There are a few ways to do this, and I'm going to explain a longer way that I figure is easier to understand since you've not worked with a script before.  A script is basically a little program that launches when you tell it to and does what you've programmed...a series of Do This and Do That's...

           

          option 1: If you can tolerate gaps in your numbering (M1, M2, M7, M14, M15, M23,...) then this whole project gets pretty easy.  You could set up a field "UniqueID" for autoentering a serial#, Set up another field called "Record_Num" and have it be a calculation something of the sort towards:

           

          If(Area=Brecht;"B" & "-" & UniqueID;If(Area=Mime;"M" & "-" & UniqueID...etc., you get the point.

          This will result in every record having a different number, but prefixed by the letter of choice.  ie. there will NOT be an M-12 and a B-12...there would instead be M-12 and B-13 with no M-13 ever created.

           

          Option 2:

          Set up the autoentered Unique ID anyway.  After you make your selection for "Area", you could run a script "label Record"  I'll abridge some of it to show the purpose...play with the details a bit yourself.

          Note: # is a comment prefix...it doesn't do anything except allow you to leave a note for yourself.

           

          # tag the record you're on so you can get back to it

          Setfield [globalID;UniqueID]

          # Set prefix letter

          If Area=Brecht

                 SetFeild[gloablenewfield1;"B"]

          EndIf

          If Area=Mime

                 SetField[globalnewfield1;"M"]

          EndIf

          # etc..

          # Find how many with that prefix already and add 1 to the number

          Go to field [Area]

          Copy

          Enter Find Mode

          Go to Field [Area]

          Paste

          Perform Find

          SetField [globaldnewfield2;Get(FoundCount)+1]

          # combine the two variables to create your record number

          >>Go to your initial record doing a find loop like above, but finding globalID in the UniqueID field

          Setfield [Record_Num;globalnewfield1 & "-" & globalnewfield2]

           

          Have a think through it, give it a try...

           

          Sorry, can't help with question #2.  Perhaps another on the board can.

          • 2. Re: 2 beginner questions -- drop-down lists & record number
            ninja
              

            I take it back,

             

            I had an idea for your multiple selection/checkboxes.  Perhaps someone else will have a better one.

             

            Make an image that LOOKS like a drop down, but is really a button.  Hitting the button will send you to Layout#2, based on the same table so you'll be on the same record.  Layout#2 will have your big checkbox field so you can choose your multiple entries.  When you're done picking them all, you have a "done" button as part of the checkbox field that sends you back to layout #1.

             

            Just thinkin' out loud...its a way to SEEM to have a drop down checkbox list without really having it.

            • 3. Re: 2 beginner questions -- drop-down lists & record number
              raybaudi
                

              Hi jiimd

               

              > 2. I have a dropdown menu (for a field entitled "keywords" with a value list that keeps updating itself based on values that I put in that field on other records.  It works. But I want to be able to select more than one item from the list.

               

              Actually a pop-up menu CAN have multiple choices... press SHIFT while choising a value.

               

              That said, it's hard to select 10 values from a value list of 100 values.