Question : referring to a form instance in front-end database

I am using a collection to manage form instances in my front-end database, such as this:

Function fOpenFormInstance(strForm As String)
    On Error GoTo Err_event
    Dim frm As Form
    Select Case strForm
        Case "frmEntityMgmt"
            Set frm = New Form_frmEntityMgmt
            clnForms.Add Item:=frm, Key:=CStr(frm.Hwnd)
            frm.Tag = frm.Hwnd
      End Select
    frm.Visible = True
Exit_Event:
    Set frm = Nothing
    Exit Function
Err_event:
    MsgBox Err.Description
    GoTo Exit_Event
End Function

I then have several different functions that I use, and refer to the active form in this manner:

Public Function fLoadEntityMgmtSubforms(strFormID As String)
    Set frmCurrent = clnForms(strFormID)
    If frmCurrent.Controls("ctlName").value = ""....

If I want to create a library db to store a lot of my functions in, how would I refer to the instance of the form in my front-end database?  (in the above example obviously the forms collection and function are in the same database)

Answer : referring to a form instance in front-end database

Working with Object instances via referenced modules (i.e. your standard library database) is not the best way, in my opinion. In my opinion, those library database should be used for code routines that don't really have to interact directly with running objects. You could perhaps alter your routines such that you would pass INTO that routine a form or report object, then your code could act upon that object. That said, I'm not sure a referenced database could do that.

It seems that most Access developers use the "import the module" routine for these sorts of things, but there are several out there using the referenced databases for code repositories.

Good luck in whatever method you choose!
Random Solutions  
 
programming4us programming4us