No, Stilleto, you're wrong about that. Any time you reference a form, it gets loaded. See your MSDN documentation.
Here's what I do to find out if a form is loaded without referencing specific forms. First, I give each form a unique tag. Then I check it like this:
VB Code:
If FormLoaded ("frmOptions", False) then ' do whatever end if Public Function FormLoaded(sTag As String, RestoreWindow As Boolean) As Boolean Dim frm As Form ' Loops through loaded forms and searches for a matching tag ' Restores window if RestoreWindow argument is true ' Form will not get loaded if it is not loaded already. On Error GoTo errHandler Hourglass True For Each frm In Forms If frm.Tag = sTag Then FormLoaded = True If RestoreWindow Then frm.WindowState = vbNormal frm.ZOrder 0 End If Exit For End If Next frm Hourglass False Exit Function errHandler: LogError Error, Err, vbNullString, "bForms.FormLoaded" Hourglass False End Function




Reply With Quote