I am drilling down through forms and only want the current form to be visible. In the command button on each form I am trying to call the following routine and I get a type mismatch.
What am I doing wrong.
Thanks
Mike
Public Sub formhide()
Dim frmcurrent As Form
Set frmcurrent = Screen.ActiveControl
Dim frm As Form
If frm.Name <> Forms!frmcurrent Then
For Each frm In Application.Forms
frm.Visible = False
Next frm
End If
End Sub
What am I doing wrong.
Thanks
Mike
Public Sub formhide()
Dim frmcurrent As Form
Set frmcurrent = Screen.ActiveControl
Dim frm As Form
If frm.Name <> Forms!frmcurrent Then
For Each frm In Application.Forms
frm.Visible = False
Next frm
End If
End Sub