howto - "modularize design" of front-end application ??

  • Thread starter Thread starter Bob
  • Start date Start date
So code in your library does not normally open forms
or reports in your CurrentDB -- If you want that, perhaps
you would use a Add-In instead of a library.

Have a look at my earlier reply in this thread for an example of code to
open a form from a referenced library database in the current one.
 
Yes, the add-in would only be used as a library to open
a form from the CurrentDB.

If you want code from the CurrentDB to open a form
from the library, you would use a reference.

(david)
 
Here's an example. Three of the 12 databases required the contractors form
which had tons of code in it for validation. Instead of trying to maintain
that form in 3 places, I put it in a CodeDB which I referenced on all 3
databases. A module maintained code to open the form:

Public Sub OpenContractors()
On Error GoTo Err_Handler
DoCmd.OpenForm "frmContractors"
Err_Handler:
ErrorSub
End Sub

You'll find the error handling code at my website:

http://www.datastrat.com/Code/Error.txt

Now in each of the 3 databases, a button had the following code:

Public Sub cmdContractors_Click()
' Code from CodeDB.mde
OpenContractors
End Sub

Simple, easy.

Wonderful!
TYVM, Arvin!
appreciate the info!
Bob
 
Back
Top