Może coś takiego się nada?
Option Explicit
Private Function Autoryzacja(haslo) As Boolean
Dim strHaslo As String
strHaslo = "123asdf"
If haslo = strHaslo Then
Autoryzacja = True
Else
Autoryzacja = False
End If
End Function
Sub cmdPassword_Kliknięcie()
Dim strPobraneHaslo As String
strPobraneHaslo = InputBox("Podaj haslo : ", "Autoryzacja")
If Not (Autoryzacja(strPobraneHaslo)) Then
MsgBox "Złe hasło!"
Exit Sub
End If
MsgBox "Hasło OK - procedura działa dalej"
End Sub |