W Wembly Sep 10, 2003 #1 Hi, How would I write the code to check whether a form is opened or not? Thanks for your help. Wembly
Hi, How would I write the code to check whether a form is opened or not? Thanks for your help. Wembly
A Albert D. Kallal Sep 10, 2003 #2 There is a number of ways to do this, and some depend on what version. However, the follwing is quite good: http://www.mvps.org/access/forms/frm0002.htm
There is a number of ways to do this, and some depend on what version. However, the follwing is quite good: http://www.mvps.org/access/forms/frm0002.htm
M May Sep 10, 2003 #3 Dim abc As Form For Each abc In Forms If abc.name = "Form2" Then MsgBox "Form2 is already open" Next May MCP in Access and SQL Server
Dim abc As Form For Each abc In Forms If abc.name = "Form2" Then MsgBox "Form2 is already open" Next May MCP in Access and SQL Server
D Douglas J. Steele Sep 10, 2003 #4 Or, slightly more efficiently, Dim abc As Form For Each abc In Forms If abc.name = "Form2" Then MsgBox "Form2 is already open" Exit For End If Next
Or, slightly more efficiently, Dim abc As Form For Each abc In Forms If abc.name = "Form2" Then MsgBox "Form2 is already open" Exit For End If Next