Public Function OpenForm(xForm As String) On Error GoTo FuncErr Dim Frm As Form If CurrentProject.AllForms(xForm).IsLoaded Then Set Frm = Forms(xForm) Frm.SetFocus DoCmd.Restore Else DoCmd.OpenForm xForm End If FuncExit: Exit Function FuncErr: MsgBox err.Description Resume FuncExit End Function