Private Sub txtPassword_Change()
[B]If txtPassword.Value = "" Then
MsgBox ("Vous devez inscrire un mot de passe valable sur ce serveur!")
End If[/B]
StrPassword = txtPassword.Value
End Sub
Private Sub txtServername_Change()
End Sub
Private Sub txtUsername_Change()
[B]If Len(txtUsername.Value) > Len(txtServername.Value) Then
MsgBox ("Vous devez inscrire un Identifiant valide sur ce serveur!")
End If[/B]
StrUsername = txtUsername.Value
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, _
CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "SVP, utilisez le bouton!"
End If
End Sub
Private Sub cmdCancel_Click()
Canceled = True
Hide
End Sub
Private Sub cmdOK_Click()
'En effectuant un clic on vérifie le mot de passe
If txtPassword.Value = "" Then
MsgBox ("Vous devez inscrire un mot de passe valable sur ce serveur!")
End If
'En effectuant un clic on vérifie l'identifiant
If Len(txtUsername.Value) < Len(txtServername.Value) Then
MsgBox ("Vous devez inscrire un Identifiant valide sur ce serveur!")
End If
Canceled = False
Hide
End Sub
Private Sub Image1_Click()
End Sub
Sub UserForm_Initialize()
'On fait apparaître la fenêtre au milieu de l'écran
Me.StartUpPosition = 2
txtServername.Value = StrServerName
txtUsername.Value = StrServerName & "\"
End Sub