D
DraguVaso
Hi,
I have a Form which has the property IsMdiContainer = True. So it contains a
whole bunch of MdiChilds. Those MdiChilds are all instances of two forms I
have: I have some that are an instance of frmSource, and some that are
instances of frmTarget.
I now have a button on my MdiParent that, if clicked on, have to refresh all
the instances of frmSource. So I putted the following code underneath it:
Dim FormSource as frmSource
For Each FormSource In Me.MdiChildren
FormSource.FillGrid_TS()
Next
This works fine when I have ONLY instances of frmSource, but it doesn't work
when I have also instances of frmTarget.
I found alreadyy a solution ofr my problem, but I still think it's a little
bit weird. (see underneath this). Does anydbody know a better/ more corect
solution?
Dim FormSource As frmSource
Dim FormTest As Form
btnRefreshAll.Enabled = False
For Each FormTest In Me.MdiChildren
If FormTest.Name = "frmSource" Then
FormSource = FormTest
FormSource.FillGrid_TS()
End If
Next
Thanks a lot in advance!
Pieter
I have a Form which has the property IsMdiContainer = True. So it contains a
whole bunch of MdiChilds. Those MdiChilds are all instances of two forms I
have: I have some that are an instance of frmSource, and some that are
instances of frmTarget.
I now have a button on my MdiParent that, if clicked on, have to refresh all
the instances of frmSource. So I putted the following code underneath it:
Dim FormSource as frmSource
For Each FormSource In Me.MdiChildren
FormSource.FillGrid_TS()
Next
This works fine when I have ONLY instances of frmSource, but it doesn't work
when I have also instances of frmTarget.
I found alreadyy a solution ofr my problem, but I still think it's a little
bit weird. (see underneath this). Does anydbody know a better/ more corect
solution?
Dim FormSource As frmSource
Dim FormTest As Form
btnRefreshAll.Enabled = False
For Each FormTest In Me.MdiChildren
If FormTest.Name = "frmSource" Then
FormSource = FormTest
FormSource.FillGrid_TS()
End If
Next
Thanks a lot in advance!
Pieter