As a consequence of certain event, I have to load a form. But, if that form is already opened, I have to set the focus on it. How can I do this?
Thanks in advance!!!!
Printable View
As a consequence of certain event, I have to load a form. But, if that form is already opened, I have to set the focus on it. How can I do this?
Thanks in advance!!!!
The easy wayCode:Private Sub Command2_Click()
Form2.SetFocus
End Sub
Ok, you are right. But I've missed some information in my post. The form I have to call is a clonation from a standard form, so I have to determine if a form with certain data is loaded, and then decide what to do. Could you help me please?
To determine if it is loadedReplace the msgbox with the setfocus.Code:Dim f As Form
For Each f In Forms
If f.Name = "Form1" Then MsgBox "Form1 already loaded"
Next