Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoiding redundancy by using a common mdb keeper of forms 1

Status
Not open for further replies.

vanleurth

Programmer
Sep 1, 2001
156
0
0
US
Hi happy programmers,

I have found myself reusing the same forms; splash, menu, etc for different databases. I have been sucessful at placing all my modules in a mdd file and using that one as a library for all my functions.

I wonder how can I use the same mdb file to store common forms. I have tried this but Access doesn't recognize forms living in attached mdb like it will with modules.

Have you tried this before? And I looking into the wrong file type? How to do this ?

Thank you in advance,

V.
 
The forms in a referenced library are available to code in that library. Simply create a Sub procedure in the library to open each form, and call that from your main database.

If you need to pass OpenArgs to the form, just make it a parameter to the Sub. The Sub can also have additional parameters to control other OpenForm options.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Rick,

Thanks for your prompt answer.
Here is what I'm trying,

DoCmd.OpenForm "frm about", acNormal

frm about is a form inside my reference mdb file. I still get;

The form named "frm about" is mispelled or refers to a form that doesn't exist.

Am I missing something?

V.
 
What I'm saying is that the DoCmd.OpenForm must be in a procedure in the library database. You can then call that procedure from your main database.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Did you just MACGYVERed that ?
Thanks, it works !!

V.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top