If I could guarantee which component the user chooses first then I know how to create the conditional value lists. Unfortunately the user enters C1 and C2 on the same layout and can do so in which ever order they want.
A simple, not very tricky way to do this would to put a validation on the C2 field that C1 is not empty. This would then force C1 to be entered first.
Thanks, but I don't want to restrict which field has to be entered first. I want the user to choose either C1 or C2 and then the other value lists adjusts.
As we discussed in another thread, this is for a web published database and you have to commit the record before the conditional value list updates. Since you can't use a script trigger to force the commit, we've got a problem here...
If we were in FileMaker and not IWP would it be possible to create these value list?
Don't see why not, with two mutally conditional value lists you have to work out some details carefully, but it can be done.
I assume that if you drop down c1 and c2 is blank you want to see all c1 values?
I assume that if you drop down c2 and c1 is blank you want to see all c2 values?
The trick here is to use calculation fields as your key fields in your relationships linking your main table to the table of values.
c1Key : If ( IsEmpty (c1) ; "All" ; c1 )
In your value table:
c1Key : c1 & "¶All"
Relationship for c2 values:
MainTable::c1Key = ValueTable::c1Key
For the c1 value list, repeat this process, but substitute c2 for c1.
Thanks! This works great in FileMaker. I will keep working on a way to commit the records without script triggers.
Figured out a way around the IWP commit problem:
Make both fields C1 and C2 buttons on the original script. Duplicate the layout twice, once where only C1 is a button and the other when C2 is a button. Connect all the buttons to the following script with different parameters depending on if it is C1 or C2:
Go to Layout[layout where C1 is not a button]
Go to Field [C1]
Go to Layout[ layout where C2 is not a button]
Go to Field [C2}
The problem with making a field a button is that you can never modify the field. But by switching to a new layout the user thinks they just entered the field.
For example, the user makes a selection for C2 then they go to choose C1. When they click C1, they actually click a button which commits the record and then sends them to a layout where C1 is just a field and not a button.
Clever! Since I am on the bring of creating my first FMP 10 IWP database, I'll keep that trick in mind for my own projects. :smileywink: