I built a form containing several functions; I need to start this form from several different databases; can I do this without copying it to all databases, which would raise maintenance problems?
Printable View
I built a form containing several functions; I need to start this form from several different databases; can I do this without copying it to all databases, which would raise maintenance problems?
AFAIK, no. You could only have one database form open another database form in a separate instance of Access.
Looks like I found some kind of "hack" to accomplish this task:
- I declare a public function in the DB library.mdb, which contain the forms;
- the function, named LaunchForm(), contains statement Application.DoCmd.OpenForm ("frmMain");
- I connect a second database main.mdb to library.mdb, as a "reference" (Menu Tools->References from source window);
- I create a form in main.mdb, containing a button which launches LaunchForm(), which appears visible also in main.mdb, and magically form appears! :)
Oh cool trick. Thanks for the update. :thumb:
Guess you would need a unique form name as if you had frmMain in both but they were different forms you may create a conflict have to fuly qualify the form when calling.
Good point.Quote:
Originally Posted by RobDog888
I just tried saving a form in a db using same name of a form in the other db, but Access does not allow it.
I guess similar check is performed when connecting a database as a reference.
Cool, at least MS was proactive on this when you add a db reference.