Private Sub Form_Load() Dim a As String a = InputBox("请输入密码") If a <> 123456 Then MsgBox "密码错误" End Else Form1.Show End If End Sub