2 Replies Latest reply on Jun 21, 2012 4:09 PM by MaximeCrevat

    Field with Value list or edit according to another field

    MaximeCrevat

      Title

      Field with Value list or edit according to another field

      Post

      Hi everybody,

      I looked online and I keep struggling on this since a day.

      I have 2 checkbox fields called customer and vendor.

      A third field called author is dependant of those checkbox, if customer is checked I would like that author display a value list with the name of the customers (no other values except the value list is accepted). It's not a big deal I know how to do it, now if customer is unchecked and vendor checked, I would like the author field not to display anything but just wait for a classic edit entry.

      I wish I managed to inform you about my problem,

      any help or idead would be appreciated,

      Thx

      Max 

        • 1. Re: Field with Value list or edit according to another field
          philmodjunk

          It is possible to use a drop down field so that text can be entered directly in the field and the drop down list can be a conditional value list that is empty if Vendor is checked and customer is not checked.

          You actually only need one field for the checkboxes unless there is another reason for having separate fields, but I will use what you have.

          First, you need a table of customer names. This can be the same table as the one you describe or a different table.

          This table, customers, needs two fields:

          Name, constOne

          Define constOne as a calculation field and enter 1 as the only thing in its calculaton.

          In your existing table, add this field, cValueFlag:

          If ( Not IsEmpty ( Customer ) ; 1 )

          Define this relationship:

          Yourtable::cvalueFlag = Customers::constOne

          If you already have a relationship between these two tables or Yourtable and customers is one and the same table, you'll need to add a new table occurrence to set this up.

          Now define your value list with the Use values from Field option.

          Click the "include only related values, starting from YourTable" radio button.

          Format the Author field as a drop down list.

          When Customer is checked, a drop down list of customer names will appear. If it is not checked, no values appear and your field is a simple edit box.

          • 2. Re: Field with Value list or edit according to another field
            MaximeCrevat

            Thank you PhilModJunk,

            It took me some time, but I managed to do it thanks to you, this just work perfectly, I never thought using the relationships between table.

            Actually I have the checkbox Internal, Vendor and Customer, so I think I still need the three of them.

            Have a good evening,

            Thank you,


            Max