Jul 22 2021 03:01 PM
Hi there,
I'm new to Access and I'm developing a database for a small business that includes an Inventory table, where all parts are listed. I am hoping to create bills of materials for assembled products (finished goods), which would include some parts from the Inventory table (parts included depend on the finished good). I want to have a front end form where the user simply selects which finished good has been ordered, with a "complete work order" function that will automatically remove the specified part quantities from the current stock in the main Inventory table. I am unsure on how I should approach this, through tables, update queries, etc.
Please let me know if anyone has developed a similar system, or any ideas on how I can move forward. All suggestions and expertise are welcome!
Thanks in advance.
Jul 26 2021 08:09 AM
@CDuest Ken Sheridan has a demo relational database application called BoM (in BoM.zip) on his OneDrive. It demonstrates the proper way to create a Bill of Materials relational database application.
Jul 27 2021 12:40 PM
Jul 27 2021 12:46 PM
@CDuest Being inexperienced with what you are asking about, I can't offer definitive suggestions.
However, in general, the technique is to start with delete queries that remove the records on the "Many" side a relationship, which is going to be the case with a BoM system. Then, when child records are deleted, you can run a delete query on the "One" side table(s) in turn.
Jul 27 2021 01:06 PM
Jul 27 2021 01:24 PM - edited Jul 27 2021 01:25 PM
@CDuest Ah, Thanks for the clarification.
Actually, I would advise against that approach, which involves a calculated value for "CurrentStock".
In a traditional relational database application, one does NOT try to calculate and store values that are dependent on other values. The risks of going out of synch are too large.
When you want to see a current stock level, the recommended approach is to use a query that does the calculation based on "Total Received" and "Total Removed" instead of risking accuracy with frequent recalculations.
How does Ken Sheriden's relational database application handle that, btw?
Jul 27 2021 01:39 PM
Jul 27 2021 04:30 PM
Again, I would expect that "removing" multiple parts at once would involve one or more delete queries, starting with the records to be removed from the child table(s).
However, it's not quite clear to me what you mean by "...removing BoMs" in the first place, so it would require more details about what that means in the context of this application.