Bonjour
Je galère sur un bout de code pour mot de passe :
Celui ci est impec
Dim Rep
Dim stDocName As String
If Me.Txt_MotDePasse = Decrypt(DLookup("MotDepasse", "AARCPMName")) Then
Psw = True
DoCmd.OpenForm "Start"
DoCmd.Close acForm, "Connexion"
Else
Psw = False
Rep = MsgBox("Mot de passe incorrect. (Lecture seule disponible après
activation.)// Incorrect password. (Read-only available after
activation.)", vbExclamation + vbRetryCancel, "E R R E U R")
If Rep = 2 Then 'Cancel
DoCmd.Close acForm, "Connexion"
Else
Me!Txt_MotDePasse = ""
Me!Txt_MotDePasse.SetFocus
End If
DoCmd.SetWarnings True
End If
End If
End Sub
Celui-ci marche très bien, mais quand j’ajoute :(accès à d’autres forms en
lecture uniquement je n’arrive plus à obtenir mon message si password est
faux et je plante)
Else
If (Me.Txt_MotDePasse = (DLookup("Lecture", "Lect"))) Then
If Not Me!AAA = "" Or Not IsNull(Me!AAA) Then
Psw = True
DoCmd.OpenForm "StartLect"
DoCmd.Close acForm, "Connexion"
qui peut m’aider avec les If, End if, Else et autres
merci par avance
jfd
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Michel_D
"jfd" a écrit dans le message de news:
Bonjour Je galère sur un bout de code pour mot de passe : Celui ci est impec
Dim Rep Dim stDocName As String If Me.Txt_MotDePasse = Decrypt(DLookup("MotDepasse", "AARCPMName")) Then Psw = True DoCmd.OpenForm "Start" DoCmd.Close acForm, "Connexion" Else Psw = False Rep = MsgBox("Mot de passe incorrect. (Lecture seule disponible après activation.)// Incorrect password. (Read-only available after activation.)", vbExclamation + vbRetryCancel, "E R R E U R") If Rep = 2 Then 'Cancel DoCmd.Close acForm, "Connexion" Else Me!Txt_MotDePasse = "" Me!Txt_MotDePasse.SetFocus End If DoCmd.SetWarnings True End If End If
End Sub Celui-ci marche très bien, mais quand j’ajoute :(accès à d’autres forms en lecture uniquement je n’arrive plus à obtenir mon message si password est faux et je plante) Else
If (Me.Txt_MotDePasse = (DLookup("Lecture", "Lect"))) Then
If Not Me!AAA = "" Or Not IsNull(Me!AAA) Then
Psw = True DoCmd.OpenForm "StartLect" DoCmd.Close acForm, "Connexion" qui peut m’aider avec les If, End if, Else et autres merci par avance jfd
Comme cela par exemple.
If (Me.Txt_MotDePasse = (DLookup("Lecture", "Lect"))) Then
Else Psw = False Rep = MsgBox("Mot de passe incorrect. (Lecture seule disponible après activation.)// Incorrect password. (Read-only available after activation.)", vbExclamation + vbRetryCancel, "E R R E U R") If Rep = 2 Then 'Cancel DoCmd.Close acForm, "Connexion" Else Me!Txt_MotDePasse = "" Me!Txt_MotDePasse.SetFocus End If DoCmd.SetWarnings True End If
"jfd" <jfd@discussions.microsoft.com> a écrit dans le message de news:04A91A41-2CFC-4D88-8A19-9A8F9C211EBD@microsoft.com...
Bonjour
Je galère sur un bout de code pour mot de passe :
Celui ci est impec
Dim Rep
Dim stDocName As String
If Me.Txt_MotDePasse = Decrypt(DLookup("MotDepasse", "AARCPMName")) Then
Psw = True
DoCmd.OpenForm "Start"
DoCmd.Close acForm, "Connexion"
Else
Psw = False
Rep = MsgBox("Mot de passe incorrect. (Lecture seule disponible après
activation.)// Incorrect password. (Read-only available after
activation.)", vbExclamation + vbRetryCancel, "E R R E U R")
If Rep = 2 Then 'Cancel
DoCmd.Close acForm, "Connexion"
Else
Me!Txt_MotDePasse = ""
Me!Txt_MotDePasse.SetFocus
End If
DoCmd.SetWarnings True
End If
End If
End Sub
Celui-ci marche très bien, mais quand j’ajoute :(accès à d’autres forms en
lecture uniquement je n’arrive plus à obtenir mon message si password est
faux et je plante)
Else
If (Me.Txt_MotDePasse = (DLookup("Lecture", "Lect"))) Then
If Not Me!AAA = "" Or Not IsNull(Me!AAA) Then
Psw = True
DoCmd.OpenForm "StartLect"
DoCmd.Close acForm, "Connexion"
qui peut m’aider avec les If, End if, Else et autres
merci par avance
jfd
Comme cela par exemple.
If (Me.Txt_MotDePasse = (DLookup("Lecture", "Lect"))) Then
Else
Psw = False
Rep = MsgBox("Mot de passe incorrect. (Lecture seule disponible après activation.)// Incorrect password. (Read-only available
after activation.)", vbExclamation + vbRetryCancel, "E R R E U R")
If Rep = 2 Then 'Cancel
DoCmd.Close acForm, "Connexion"
Else
Me!Txt_MotDePasse = ""
Me!Txt_MotDePasse.SetFocus
End If
DoCmd.SetWarnings True
End If
Bonjour Je galère sur un bout de code pour mot de passe : Celui ci est impec
Dim Rep Dim stDocName As String If Me.Txt_MotDePasse = Decrypt(DLookup("MotDepasse", "AARCPMName")) Then Psw = True DoCmd.OpenForm "Start" DoCmd.Close acForm, "Connexion" Else Psw = False Rep = MsgBox("Mot de passe incorrect. (Lecture seule disponible après activation.)// Incorrect password. (Read-only available after activation.)", vbExclamation + vbRetryCancel, "E R R E U R") If Rep = 2 Then 'Cancel DoCmd.Close acForm, "Connexion" Else Me!Txt_MotDePasse = "" Me!Txt_MotDePasse.SetFocus End If DoCmd.SetWarnings True End If End If
End Sub Celui-ci marche très bien, mais quand j’ajoute :(accès à d’autres forms en lecture uniquement je n’arrive plus à obtenir mon message si password est faux et je plante) Else
If (Me.Txt_MotDePasse = (DLookup("Lecture", "Lect"))) Then
If Not Me!AAA = "" Or Not IsNull(Me!AAA) Then
Psw = True DoCmd.OpenForm "StartLect" DoCmd.Close acForm, "Connexion" qui peut m’aider avec les If, End if, Else et autres merci par avance jfd
Comme cela par exemple.
If (Me.Txt_MotDePasse = (DLookup("Lecture", "Lect"))) Then
Else Psw = False Rep = MsgBox("Mot de passe incorrect. (Lecture seule disponible après activation.)// Incorrect password. (Read-only available after activation.)", vbExclamation + vbRetryCancel, "E R R E U R") If Rep = 2 Then 'Cancel DoCmd.Close acForm, "Connexion" Else Me!Txt_MotDePasse = "" Me!Txt_MotDePasse.SetFocus End If DoCmd.SetWarnings True End If