Hi everyone,
For the simplicity, let's assume we have a multinational company with different businesses:
1) selling food
2) manufacturing toys
3) growing oranges
Idea was to build the one Access tool per business, all together three tools, which would be accessed independently.
After finishing the Food.mdb tool, I realized that I would actually need an access to all three tools from one place (one form).
So I've built one Master form frmMaster inside MasterDBA (previously called Food.mdb), with the different business blocks and buttons on the form.
Structure of frmMaster:
cmdFood_EnterData - opens frmEnterData
cmdFood_Charts - opens frmCharts
cmdToys_EnterData - not linked
cmdToys_Charts - not linked
cmdOranges_EnterData - not linked
cmdOranges_Charts - not linked
As the tools will be now combined, I need to change all the Forms, Queries, Tables and Sub Routine names in the modules.
I've started with forms, changing frmEnterData to frmFood_EnterData, and frmCharts to frmFood_Charts.
I've used search&replace function in the VBA editor to correct the code.
But now I need to to the same for each called subroutine, queries and tables, because the future tools Toys and Oranges will for sure be using some of the same sub routine and other names.
My question is - is there a better way to solve this?
For example, is it possible somehow to put all the code, tables and queries from Foods tool into one collection, so when entering the frmFood_EnterData only this collection would be called.
And when entering Toys and Orange forms their specific collections would be called, and would operate seperately from each other.
And if I would need to combine data from couple of collections, for example for Total Revenues of all the businesses, I would just call different collection instance.
For example this would be much easier if possible:
cFood.tblData("Revenues")+cToys.tblData("Revenues" )+cOranges.tblData("Revenues")
instead of renaming everything and then calling like this:
tblFood_Data("Revenues")+tblToys_Data("Revenues")+ tblOranges_Data("Revenues").
Any help is greatly appreciated.