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

Establishing if a form is open

Status
Not open for further replies.

RobS23

Programmer
Jun 4, 2001
161
GB
Having a blank day today....so rather than trawl through the wonderful world of MSDN...

Can someone let me know if there is a simple way of establishing if a form if open in my MDI.

It's in it's early stages so I haven't yet created my own forms collection - I just need to know when I am saving a record whether a particular form is open.

Something along the lines of

if frmMyForm is open then....



Ta

Rob
 
Code:
Dim frm As Form
Dim blnFormOpen

'assume form not open
blnFormOpen = False

For Each frm In Forms
  ' exclude MDIForm
  If Not TypeOf frm Is MDIForm Then
     ' only looking at MDIChild forms
    If frm.MDIChild Then
      If frm.Name = "frmMyForm" Then
        blnFormOpen=True
      End if
    End if
  End if
Next 
 
if blnFormOpen then ...

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top