Using a form's name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need an if statement to say

If Form_frm_Main.Visible = True Then something or
If current FormName = "frm_Main" then something.

How can I refer to a form name

Thanks
 
If Forms("frm_Main").Visible = True Then

(of course, the Forms collection only contains open forms, so you'll get an
error if frm_Main isn't open)

If Screen.ActiveForm.Name = "frm_Main" Then
 
Or, if you need to know if the form has been loaded:

If CurrentProject.Allforms("FormName").IsLoaded Then
MsgBox "Form Is Loaded"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top