Gruppe
Dialog
Problem
Wie kann ich über eine UserForm ein Paßwort abfragen und je nach Wahrheitsgehalt der Antwort die Steuerung vornehmen? Das Paßwort darf nicht angezeigt werden.
ClassModule: frmPasswort
Private Sub cmdAbbrechen_Click()
MsgBox "Kein Zugang!"
Unload Me
End Sub
Private Sub cmdOK_Click()
If txtPasswort.Text = "Paßwort" Then
MsgBox "Alles klar!"
Unload Me
Else
MsgBox "War wohl nix!"
txtPasswort.Text = ""
txtPasswort.SetFocus
End If
End Sub
Private Sub UserForm_Initialize()
txtPasswort.SetFocus
End Sub
StandardModule: basMain
Sub CallForm()
frmPasswort.Show
End Sub