bar891
05-31-2008, 03:52 PM
I hope i can explain this so everyone understands!
I have a simple inventory db. The problem i have is that the inventery items can be stored in three different locations & can have items stored in all three locations at any one time.On my purchace form i must have some way of imputing the quanties at each location, then when it is invoiced out, Taking from each location.
I am just confused of the structure i need to accomplish this.Can someone point me in the right direction as i am new to access 2007.
Many Thanks:D
georgedwilkinson
05-31-2008, 05:22 PM
You need a table called something like "Container" which could be a bin location, a pallet, a shelf, or any other place you can store product. One of the columns is "Location", another is "type".
You also need a junction table called "ProductContainer" or "ProductLocation" with a FK from both your inventory/product table and your Container table.
That's the easy part. You didn't ask about but will need some pretty fancy logic on your "sales" form to specify which location you'll pulling product from. Same with purchase order reconciliation.
Sounds like a fun project.
bar891
05-31-2008, 07:36 PM
So for the "Container" table the type would be the "part Number"?
What does the junction table do exactly?
As for sales i was going to take all sales from location as this is what generally happens at the momement, and design a form to transfer items between locations. Does that sound feasible?
georgedwilkinson
05-31-2008, 10:18 PM
I don't think you understood what I was saying. These tables are virtual representations of real-world things. A container is something you put something in, no more. It has a location in 3D space and perhaps measurements.
A Part is a discrete thing that you presumably will buy from a vendor and sell to a customer. A part has its own elements that have nothing to do with where you got it from, where it's going to, or who you bought it from or sold it to.
In order to record the fact that you have put a "Part" in a "Bin", you need a structure to record the information about that. That is what a junction table (AKA, Associative Table or M:M) is for. The junction table records the fact that a "Part" is in a "Bin", when it was put there, who put it there, who took it out of there, and so forth. It is a virtual representation of an event that occurred or is expected to occur.
To get a better understanding, please look up data normalization on this site and on google.
As far as designing a form to do some action, you might want to think of designing a form to manipulate data in tables. All you really need to do with a form is display, change, delete, and add data into tables. And the neat thing about it is that if you design the tables correctly, the forms just kinda fall into place. If you don't, the system tends to give you and everyone who works on it trouble for years.