Hi,
I am using Access 2016. I am creating a program that tracks orders in a company. Each time an order is placed, an order number is assigned to the order, and depending on what the customer wants, item numbers are assigned to each type of part that they are ordering. There could be multiple items on each order, and there could be multiple parts per item made; for example, if a customer orders 4 pipes to be made, those pipes are assigned 1 item number, and each pipe is then assigned a serial number under that item. So, the order in total would be something like this: Order # 5, item 1, serial numbers D-1, D-2, D-3, and D-4.
Sometimes certain instances require an item number or specific serial number of an item to be moved to a different order. For instance, if we consider the previous example of the 4 pipes, pipe D-4 may need to be moved to Order #6 for some reason, but none of the other pipes. In other instances, an item number may need to be changed but remain on the same order number. For instance, if we consider the previous example, item 1 (containing pipes D-1 through D-4) may need to be changed to item 2 but still remain on Order #5. And finally, some cases may require both the order number and item number to change, so for instance, Order #5 may change to Order #6 and item 1 may change to item 2.
I need to create a form that will allow the user to do this process with ease. The issue I have, however, is that I have two tables linking this data: a Customer Info Table and an Inspection Table. The Customer Info Table holds the Order Number and Item Number, and the Inspection table holds the serial numbers for each part. The two tables are linked via the ID of the Customer Order Info Table and a Customer_ID field created in the Inspection table. This is what the relationships look like and how the Order/Item numbers in the Customer Order Info table are linked to the Inspection Table:
Since the ID numbers are linked, if an order number or item number is to be changed and moved to a different order, the ID number would need to change. The user will not have any direct access to the ID number because, for ease of use, I only want them to have to deal with the Order Numbers and Item Numbers. So my idea is to allow the user to choose which order they want to modify and type in the new Order Number and/or Item Number that they want to move the part to. This would mean that in the background, the database would actually be modifying the ID number. Is there a way that I can code this with VBA or a macros to get the ID number to change based on the information the user enters?