I have an app that manages inventory and sales data. It uses an MS Access database. There are multiple inventory tables and multiple sales tables with exactly the same structure for each type. All inventory is controlled with three part SKU numbers. The parts are a text prefix, a number sequence, and a text suffix. As part of entering new inventory records I must obtain the last number used for a given SKU prefix. My preference would be to join all the inventory tables together, end-to-end, and then run a query on the prefix. Once limited to records matching the prefix I can obtain the highest value for the sequence number and add one.
I know there is a dbpDefineRelationship command, but as far as I can tell that requires one table to be subordinate to the other through a common field and that's not what I want. I want them joined end-to-end like one long table. If I can do that then my process would be to join all inventory tables, join all sales tables, then query each joined set for the highest number for a given prefix, then take the higher value between sales tables and inventory tables and add one to get my next number.
I know this can be done by opening and querying each and every table one at a time, but that's much less efficient.
Does anyone know how to do a flat end-to-end join or if it is even possible with Access?
Thanks.