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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to detect when the child form been unload

Status
Not open for further replies.

Vincentan

MIS
Aug 21, 2002
52
MY
Great Expertise!

I have mainform and childform and I have datagrid in my mainform where adodb in childform for update, I need to refresh my mainform datagrid when child form been upload.

How do i detect in mainform when my childform been unload? and I will fire some function in my mainform when I detect my childform been unload.
 
Heres one way
Code:
Public Function fnCheckIfFormLoaded(myformname As String) As Boolean

Dim frm As Form

For Each frm In Forms
    If frm.Name = myformname Then
        fnCheckIfFormLoaded = True
        Exit Function
    End If
Next

fnCheckIfFormLoaded = False

End Function

'sample use
If fnCheckIfFormLoaded("xxx") Then
   MsgBox "form loaded"
Else
   MsgBox "form not loaded"
End If
 
Hi 1100

thanks for your help but it's look dosent help my app, but i feel there is something form_deactivated function can be call where fire at the even handler, do you have any idea on this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top