Checking to see if a MDI Form is open

Checking to see if a MDI Form is open

I have an MDI application; when I Unload one form I want to check to see if another form is open and if it is run some code that refreshes it.I’ve tried using

if frmname.visible=true 

to see if its open but this doesn’t work (it loads up the form if it isn’t open).How do I check to see if a form is open?

If the target form is loaded, it will be included in the Forms collection. In the Unload event of the first form, call a RefreshForm procedure that loops through the Forms collection and looks for the desired form. If it’s there, refresh it:

   Private Sub Form_Unload(Cancel As Integer)       Call RefreshForm(frmOne)   End Sub   Public Sub RefreshForm(frmTarget As Form)       Dim frm As Form       For Each frm In Forms           If frm Is frmTarget Then               ' Call your refresh               ' code here           End If       Next   End Sub
Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved