Forum Discussion

ChrisSwirtz3's avatar
ChrisSwirtz3
Qrew Member
2 years ago

Restricting choices in a Text - Multiple Choice field

In the app I am working on I have a Text - Multiple Choice filed with years listed on it that a user is to select from when creating a request. My client is asking that I limit that field so that a user can only select the current year or a year in the future. Obviously I can remove the past years as options for now, but short of someone manually going in every year and removing the previous year, the only other way I can think to do this is to create a child table with years as the records and create a report to use in place of the standard record picker that restricts the years listed to the current year or after. Does anyone have another idea?

------------------------------
Chris Swirtz
------------------------------

4 Replies

  • You can use 'another field' as the source of the list.   I believe you can just use a formula text or numeric field to generate the list of valid dates and populate the multiple choice field from that.

    ------------------------------
    Jeff Peterson
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Qrew #1 Challenger
      A multiple-choice field it's kind of the expedient method for offering choices.  I get more control if you go the extra step and make it a relationship. You can transition existing data by making the key field of your choices table a text or a numeric field with all the values in your current multiple-choice field. 

      Then make the relationship to the existing detail record table based on what was your multiple choice field.

      Then you can make a report of the valid years and set the form properties for the drop down choice to use that report.

      ------------------------------
      Mark Shnier (Your Quickbase Coach)
      mark.shnier@gmail.com
      ------------------------------
      • ChrisSwirtz3's avatar
        ChrisSwirtz3
        Qrew Member
        That's what I thought as well Mark. However, I started this and got stuck. I created a new table called "Year" and created a Numeric field of the same name. Then I created a record for each year starting with 2022 out to 2050 for now. But these are numbers not actual "Years", so when I went to make the report thinking could filter the list to only show records where the Year is during or after the current year, that wasn't an option because I wasn't using a date field. But date fields show more than just the year, so how do I produce just a list or records showing just the year to then use as the list for the drop down on the Parent record? I expect I am missing something simple.

        ------------------------------
        Chris Swirtz
        ------------------------------