MsgBox über CommandButton öffnen...
01.01.2007 17:50:48
André
ich habe mir folgendes aus dem Netz gezogen:
<pre>
Private Sub CheckBox1_Click()
Dim sWord As String
If CheckBox1.Value = True Then
sWord = InputBox("Passwort:")
If sWord = "" Then Exit Sub
If sWord = "1234" Then
MsgBox "Passwort ist OK"
Unload Me
Else
MsgBox "Falsches Passwort"
End If
End If
End Sub</pre>~f~
Ich wollte das ganze jetzt über einen CommandButton, nur leider funktioniert folgendes nicht:
~f~<pre>
Private Sub CommandButton1_Click()
Dim sWord As String
If CommandButton1 = True Then
sWord = InputBox("Passwort:")
If sWord = "" Then Exit Sub
If sWord = "1234" Then
MsgBox "Passwort ist OK"
Else
MsgBox "Falsches Passwort"
End If
End If
End Sub</pre>
Was muss ich ändern?!