October 16, 200421 yr Hi, I am migrating from FMP3 to FMP7 and I love the new features. There is one thing I am trying to do that is making my noggin' hurt and I would appreciate any suggestions for a way to do this. I have a form which I want to be multifunction. A button at the top is clicked to toggle the form between 'Ordering Mode' to 'Stock Control Mode'. When the button is clicked, all the button labels etc on the layout change to reflect the new mode and so on. However, if the user is in 'Ordering Mode' they need a drop down list of our suppliers (which would point at a global field) so they can select which one they want to work with. But if they are in 'Stock Control Mode', they need a drop down list of Stock Control Actions (eg 'add to stock', 'remove from stock'). Is it possible somehow to assign seperate value lists to a single field, or change the field on the form when they select a new mode, or use a relationship somehow to affect the displayed value list? Any help would be greatly appreciated as I am running low on Ibuprofen Codeus
October 16, 200421 yr It seems to me that the easiest thing would be to have 2 layouts. Then all your script has to do is switch between the layouts.
October 16, 200421 yr Author I found a solution to this that works OK. In my main table I added a calculation field with a constant '1' in it for all records to use as a link. I created a new linked table called 'VariableValueList' and added three fields and a single record: - number.RelatonshipLink = 1 text.ValueListHolder = "" text.ReturnValue = "" I then dropped the 'text.ReturnValue' field in to my layout and formatted it as a pop up-list, using values from field, 'VariableValueList::text.ValueListHolder'. I then created a script which dumped the correct value list in to the ValueListHolder field using the ValueListItems control with an IF statement: - Set Field: ValueListHolder; If ( Mode = "ordering"; ValueListItems("<database name>";"<supplierlistname>"); ValueListItems("<database name>";"<stockcontrollistname>") ) Upon running the script the ValueListHolder field is populated with the correct list, once you select an item from the drop down box, that value is placed in the 'ReturnValue' field ready for use. I hope my solution helps others and I would still like to hear any other suggestions for doing this kind of thing. Codeus
Create an account or sign in to comment