If I try to access any property of a child form ( still NOT loaded in memory ) from a MDI Form, the child form is automatically loaded into memory.
I wish to access these property WITHOUT the form automatically loading.
Refer to below code.
in the line " If objForm.Name = Myform.name Then", the result is always true because the moment VB engine encounters "Myform.name", it automatically loads this form into memory and returns "True". Thus I am unable to determine if "Myform.name" was loaded in memory before execution of this procedure or not.
Public Sub CheckFormStatus(Myform As Form)
' This procedure determines if "frmbycode" is open in the background when
' "frmbyname" is exited. If yes, it displays "frmbycode" before exiting.
Dim objForm As Form
Dim FormLoaded As Boolean
Dim FormShown As Boolean
FormLoaded = False
FormShown = False
For Each objForm In VB.Forms
If objForm.Name = Myform.name Then
FormLoaded = True
If objForm.Visible Then
FormShown = True
MsgBox "Load Status: " & FormLoaded & vbCrLf & "Show Status:" & FormShown
' Myform.Show
End If
Exit For
End If
Next
End Sub
!--removed tag-->
Enter your message below
Sign in or Join us (it's free).