November 13, 200124 yr Hi, I'm just starting with FMPro5, or any databases for that matter. I am trying to make a DB that has a set of fields with a pull down menu that has choices of foods. I also have a field that I would like to display certain numbers depending upon the choice in the pull down menu field. I'm not sure how you would do this. I figured out that if I make the second field a 'calculation' field, I can use an if statement something to the effect of, "if the food field is (lets say) eggs, then display (lets say) 3, if not, then display 0" My problem is, I have a long list of choices under the pull down menu of foods, and I want a variety of numbers to display, depending upon the choice. Is that even remotely clear? Thanks in advance if you are able to help. Paul
November 14, 200124 yr If you have a long list of items, you're probably better off using a related file (Foods.fp5) to store the values. An added bonus is that you can base your value list on the field in this related file. And, updates to the related file will automatically be reflected in your value list. The related file would have two fields, FoodName and Number. Create a record for each Food/Number combination. You would base your value list in the main file on the FoodName field in the related file. The displayed number would then just be the related Foods::Number field. [ November 13, 2001: Message edited by: BobWeaver ]
November 14, 200124 yr That is one way and you can use CASE, which will be shorter, those IFs. Or you can write the number directly with text in valuelist and then just extract the number. And even better will be to create the value list "on the fly" from field or even from another database.
Create an account or sign in to comment