Hi everyone! I'm making a stock control database at work and I'm caught up on this one feature.
Each part we keep in stock for manufacturing has a part ID, PartRefID, which is formatted as 00-0000. The first two digits are the part type code. For instance, 11 is metalwork, 12 is hardware, 13 is resistors, and so on.
Therefore I've made a different table for each part type, so that we can use the autonumber feature to generate new part IDs which all begin with the correct two numbers. I've then used a union query to pull together all this data and make it searchable in a form (say, to find all parts from Farnell regardless of part type).
However of course, this means that when we want to add a new part through a form, there are multiple part tables the new record could be added to, but only one of which it should be added to.
What I'm trying to do is create an input form for new parts, which has a combo box for part type. The end user then only has to select "metalwork" or "resistors", enter the rest of the part information (PartName, MinStockLevel, CostPrice, Supplier, etc), and click "save".
The idea here is that selecting "metalwork" would append that new record to tbl_metalwork, while selecting "hardware" would append it to tbl_hardware, and so on.
Please could anyone here give me some advice on how this can be done? Thank you!
Each part we keep in stock for manufacturing has a part ID, PartRefID, which is formatted as 00-0000. The first two digits are the part type code. For instance, 11 is metalwork, 12 is hardware, 13 is resistors, and so on.
Therefore I've made a different table for each part type, so that we can use the autonumber feature to generate new part IDs which all begin with the correct two numbers. I've then used a union query to pull together all this data and make it searchable in a form (say, to find all parts from Farnell regardless of part type).
However of course, this means that when we want to add a new part through a form, there are multiple part tables the new record could be added to, but only one of which it should be added to.
What I'm trying to do is create an input form for new parts, which has a combo box for part type. The end user then only has to select "metalwork" or "resistors", enter the rest of the part information (PartName, MinStockLevel, CostPrice, Supplier, etc), and click "save".
The idea here is that selecting "metalwork" would append that new record to tbl_metalwork, while selecting "hardware" would append it to tbl_hardware, and so on.
Please could anyone here give me some advice on how this can be done? Thank you!