I have 3 Master tables.
Table 1: Breeds with Fields: BreedID (INT), BreedCode (VARCHAR), Breedname(VARCHAR)
Table 2: Colours with Fields: ColourID (INT), BreedID (INT), ColourCode (VARCHAR), Colour (VARCHAR)
Table 3: Pattern with Fields: PatternID (INT), BreedID (INT), PatternCode (VARCHAR), Pattern (VARCHAR)
Working Table 4: Cats
Fields: TableId (INT), Name (VARCHAR), BreedID (INT), Colour_1 (INT), ColourCode (VARCHAR), Pattern_1 (INT), PatternCode (VARCHAR), ColourPattern (VARCHAR)
All first keyfields are auto_increment.
Adding to Cats
- Fill textfield Name - OK
- Lookup for BreedID (table: Breeds, link_field: BreedID, display_field: Breedname) - OK
- Lookup for Colour_1 (table: Colours, link_field: ColourID, display_field: Colour)
Dependent: Cat.control: BreedID, cat.Field: BreedID - OK
- --- ???? --- HOW TO FILL FIELD ColourCode AUTOMATIC WITH Colours.ColourCode AFTER 3.
- Lookup for Pattern_1 (table: Pattern, link_field: PatternID, display_field: Pattern)
Dependent: Cat.control: BreedID, cat.Field: BreedID - OK
- --- ???? --- SAME AS 4. HOW TO FILL FIELD PatternCode AUTOMATIC WITH Pattern.PatternCode AFTER 5.
- --- ???? --- HOW TO FILL FIELD ColourPattern with Concatenation of fields ColourCode and PatternCode
Example:
Breeds: BreedID | BreedCode | Breedname
1 | PER | Persian
2 | MCO | Maine Coon
3 | SIA | Siamese
Colours: ColourID | BreedID | ColourCode | Colour
1 | 1 | n | Black
2 | 3 | o | Cinnamon
3 | 2 | as | Blue Silver
Pattern: PatternID | BreedID | PatternCode | Pattern
1 | 3 | 21 | Tabby
Cats: TableId | Name | BreedID | Colour_1 | ColourCode | Pattern_1 | PatternCode | ColourPattern
1 | Garfield | Siamese | Cinnamon | o | Tabby | 21 | o 21
Thanks for reading and any help welcome