Jack Posted June 28, 2002 Posted June 28, 2002 I have a production workorder for an item that has several attributes. Example: a pendant that can be gold, silver, brass, aluminum. The shape can be: flat, curved, semi curved. The attachment can be: pin, ring, clip, none The color lettering can be: green, red, blue. etc... I currently use drop down boxes to select the attributes for each pendant. That means 4 or 5 drop down boxes. I would like to number each attribute and make a single entry to come up with the final set of attributes. For example entering 1,6, 8, 12 would give me gold, curved, ring, red. I know that I can concatenate every possible combination of numbers to achieve the result, but I am sure someone can suggest an easier method. Thanks Jack
The Bridge Posted June 28, 2002 Posted June 28, 2002 There are a number of ways you can do this; if the options depend on what sort of jewellery you're referring to, i.e. more than just pendants, you may want to look into a series of related files. However, here's a quick answer: Two fields: Style_Code (text) Style_Result (unstored, text) = Choose(TextToNum(LeftWords(Style_Code, 1)), "", "gold", "silver", "brass", "aluminum") & ", " & Choose(TextToNum(MiddleWords(Style_Code, 2,1)), "", "flat", "curved", "semi curved") & ", " & Choose(TextToNum(MiddleWords(Style_Code, 3,1)), "", "pin", "ring", "clip", "none") & ", " & Choose(TextToNum(MiddleWords(Style_Code, 4,1)), "", "green", "red", "blue") This will parse the Style_Code field (no commas required in entry, by the way, as long as there is a space between values) The obvious drawback to this method is that the values are hard-coded, which is why I suggest looking into using related files to draw the values from. A bit more work up-front, but a time-saver down the road.
Jack Posted June 28, 2002 Author Posted June 28, 2002 Peter: I don't have a problem using related files, but how do you suggest I do it so I don't have to create a record for each possible combination ? Thanks. Jack
The Bridge Posted June 29, 2002 Posted June 29, 2002 Here's one option, off the top of my head. I tried out a quick test which seemed to work well. Here's a basic run-down. Two files: Style_Code.fp5 and WorkOrder.fp5 Style_Code.fp5 fields: Code (unique serial number) Description Description is every descriptive word, e.g. Pendant, Ring, Earring, Gold, Silver, Platinum, Flat, Curved, Semi-Curved, Pin, Ring, Clip, Green, Red, Blue WorkOrder.fp5 fields: Style_Code (text) Jewellery_Type_Key = LeftWords (Style_Code, 1) Metal_Key = MiddleWords (Style_Code, 2, 1) Shape_Key = MiddleWords (Style_Code, 3, 1) Attachment_Key = MiddleWords (Style_Code, 4, 1) Colour_Key = Middle Words (Style_Code, 5, 1) Define 5 relationships from WorkOrder.fp5 to Style_Code.fp5, the various calculated keys to Code. Then, in WorkOrder.fp5, define this field: Style_Description (unstored, text) = Jewellery_Type|Jewellery_Type_Key::Description & ", " & Metal|Metal_Key::Description & ", " & Shape|Shape_Key::Description & ", " & Attachment|Attachment_Key::Description & ", " & Colour|Colour_Key::Description To take this to the next level, you can split Style_Code.fp5 into 5 different databases: Jewellery_Type.fp5, Metal.fp5, Shape.fp5, Attachment.fp5, and Colour.fp5. This will be particularly helpful when you need to store information specific to those various qualities, e.g. the current price of gold, the cost of a particular clasp. I hope this gives you some ideas.
Jack Posted June 30, 2002 Author Posted June 30, 2002 Thanks Peter, I'll try it our over the weekend and see if I get it right. jack
Recommended Posts
This topic is 8183 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 accountSign in
Already have an account? Sign in here.
Sign In Now