以下是我寫的程式碼,我是希望在輸入錯誤的密碼時能選擇重填或是取消進入程式。現在的是問題我選擇取消進入主程式時,本應該結束的這所有程式的,但卻進入了主程式當中,只是所有的功能皆失效了,不知道是不是我的程試碼有問題?請大家幫幫忙,謝謝大家!!
Private Sub Form_Load()
frmPword.Show 1
End Sub
Dim password As String
Private Sub txtPword_keypress(KeyAscii As Integer)
password = "kay"
If KeyAscii = 13 Then
If password = txtPword.Text Then
MsgBox "您的通行證號碼無誤!!歡迎進入本程式", 48, "測試"
Unload frmPword
Else
Button = MsgBox("您輸入的密碼錯誤!再試一次?", 4 + 48, "測試")
If Button = 7 Then
End
Else
txtPword.Text = ""
Beep
End If
End If
End If
End Sub
arrow
arrow
    全站熱搜

    vbqa 發表在 痞客邦 留言(3) 人氣()