Did you know that you can drag and drop items from the navigation pane in one Access database to another Access database? I used this feature today as I needed to copy a somewhat complex form to display a series of entries in a linked table in both databases filtered differently for each database.
The use case for the form is to display files that have already been “staged” into a database and “process” that staged data to load it into the current database. Each database supports different types of files like an 820 payments file for the payments database or an 830 forecast file. I had already setup the form to load the 830 files in the forecasting database, but wanted to make a copy with some minor adjustments for the billing database to import the payments.
Only certain files are actually processed so this allows users to choose which data will actually be loaded into their database.
So, I started by copying the form object itself by dragging and dropping the form from the navigation pane in the forecast database into the navigation pane of the billing database. Then I went into the VBA debug menu to do a compile. Right away it found objects that were missing, so I copied over modules and class modules until the database compiled.
Then when I opened the form, it needed to access a temp table, so I used drag and drop to copy the structure of the temp table over to the billing database as well.
Alternative methods are to use Copy and Paste (you can also do this from the navigation pane by right clicking on an entry there and choosing copy, then right clicking anywhere on the destination database’s navigation pane and choosing paste.
There is also an import/export dialog for Access database objects where you get a wizard that asks where the file is located. Then it presents a series of lists with database objects you can bring over. It’s a little more time consuming than using drag and drop.
Also note that you can select multiple objects in the Navigation pane and drag all of them at once. I was using the compile method to make sure I wasn’t bringing over any more database objects than I actually needed to compile the database. I ended up copying about 12 objects, and it took me about 15 minutes, but after that (with slight code adjustments) it was working with the new set of data.