Jump to content

One feild selection changes another fields options


makavelii

This topic is 8453 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I want to be able from one feild, to select an item from a drop down menu, that depending on what I choose from there, changes the options in another drop down menu.

example:

Subcontractor (Drop down menu)

Description (Drop down menu)

depending on the subcontractor, the description menu will change specifically for the sub chosen.

Any help would be appreciated....THANKS!

Link to comment
Share on other sites

  • Newbies

I thank you for the reply, however being extremly green with FM, I respectfully ask for more specific information....I searched through the topics, but being unfimiliar with the terminology, I couldnt find what I was after, the website mentioned offered me a few exampes, but I'm not quite sure how to decode them, and I searched through the FM help files to no avail.....THANKS!

Link to comment
Share on other sites

Okay, one more time. Actually, considering how many times this has come up, it should have been posted to the FAQ forum a long time ago.

To do what you want, you have to have a relationship set up to another file.

As an example, suppose you have a value list set up that lists Customers. When you select the customer, you then want another menu to display invoices for that customer only. To do this, your related file must have a CustomerID field and an InvoiceID field, and a record for every invoice. In most cases, if you have a well planned database, this will be a file that you have already created. The relationship is set up between a CustomerID field in the main file, and the CustomerID field in the related file. The value list for the CustomerID menu in the main file can be either a list that you manually create, or created from the CustomerID field in the related file by selecting the "Use values from a field" option and specifying "All values" and the file name, and then CustomerID field.

Now, to make the conditional menu for the Invoice, you go to the define value lists dialog, and select "use values from field", then select "Only related values", select your previously created relationship from the relationship list and finally select the InvoiceID field.

For Filemaker versions 3 and 4 the "Only related values" option is not available. In that case to perform the function of the second conditional menu, you can create a portal to the related file and display the invoice numbers. You can turn a portal into a pseudo list menu by placing a transparent button over the all the fields in the portal row. The button then executes a script that sets another field to the value of the related field.

Set Field [selectedInvoice = RelatedFile::InvoiceID]

[ March 24, 2001: Message edited by: BobWeaver ]

Link to comment
Share on other sites

I know of two ways to make a conditional value list. The first involves creating a new Options DB file and creating a value list form a related file as mentioned in earlier posts.

The second way of making conditional value lists involves stacking fields. This works well if there are a limited number of category options. 1): define a value list for the CategoryField, 2) define as many TextOptions fields as there are categories and for ease of explanation I will use an example. For categories fish, birds mammals, you would define a FishText, BirdText, MammalText fields. 3) define a value list for each of the categories and format the respective field with the corresponding value list (the VL custom entries of trout, muskie, guppy formated to FishText...4) Define a calculation field TopTextField that is a case statement: (for example) Case(CategoryField="fish", FishText, CategoryField="bird", BirdText,...) 5)Make a script "if CategoryField="fish", go to FishText else if CategoryField="bird", go to BirdText..... 6)Format the TopTextField so that it cannot be entered and as a button with the script you just made. Last) stack the text options field on top of eachother so that TopTextField is on top (hence the name). Now, when the user "enters" the TextOption field he/she is taken to the appropriate text field below without knowing it, and the correspoding VL pops up. Then when he/she makes the VL choice, it is entered into the top field.

The advantage of the first method is there is no limit to the number of categories as these can be easily added to the options file. The disadvantage is that the value list cannot be edited by the user as would a conventional value list. The advanages and disadvantages for the second method are exactly reversed.

Link to comment
Share on other sites

This topic is 8453 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.