你可以去编写maintablechanged事件
Select Case MainTable.Name
Case "表A", "", "表C"
Forms("窗口1").panel.parent.parent.Visible = True
Case Else
Forms("窗口1").panel.parent.parent.Visible = False
End Select