Aug 18 2022 08:38 AM
Aug 18 2022 09:05 AM
Define "sort properly", please.
Also, what is the goal here? When Access developers see the words "Key fields" we think of something very specific, so it may be that an appropriate answer would depend on why you are creating this field and what you plan to do with it.
Aug 18 2022 09:27 AM
George, thanks for replying. I have a set of baseball cards that are numbered 1 thru 24. Some of them have variations. The variations of the first card should be numbered 1a, 1b, 1c, etc. If this is a text field, they sort 1, 11, 2, 20, etc. I could do 1.1, 1.2 as a numeric field but I really don't want to do it that way. I hope I'm explaining this so you can understand.
Aug 18 2022 10:55 AM
Aug 18 2022 10:57 AM
Aug 18 2022 11:28 AM
Actually, this is two tables, in my opinion, not one with this concatenated code field.
The main table (the one-side of the relationship) is the "Master Card."
Each card type is listed here in this table.
Each variation is listed in a related table (the many-side of the relationship).
If a card has one and only one instance, then there are no records for it in the variation table. As you add variations, they are recorded in the variation table with a foreign key reflecting the Card's Primary Key and a sequence letter for it, e.g. "1a". That way, you can join the two tables to get a complete list.
That does leave the problem of a single card being "1" and having no "a" or "b" etc.
You could approach that in two ways. One, accept the fact that the master card is "1", "2", etc. and you'll only see the variation code IF there are actually variations. Two, finesse the original master with the "A" as suggested. I prefer the first option.
Aug 18 2022 01:10 PM
Aug 19 2022 12:20 PM