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

How to check if there are other forms opened

Status
Not open for further replies.

djmc

Programmer
Jun 12, 2002
179
CA
How do i check if there are other forms opened (other than the current one). I want to prompt the user to close off all forms before proceeding with the task on the current form im in.
 
Hi,

Following code will work for you,

-------------------
Dim frm As Form

For Each frm In Forms
If frm.Name <> Me.Name Then
MsgBox &quot;close other forms&quot;, vbInformation
Exit Sub
End If
Next frm
-------------------


Hope this helps... :)
Hasu
(Trust on someone, someone will trust you!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top