Créer un formulaire login à l'ouverture d'une base de données [Résolu/Fermé]
Signaler
rfsd
rfsd
- Messages postés
- 7
- Date d'inscription
- mercredi 19 novembre 2014
- Statut
- Membre
- Dernière intervention
- 20 novembre 2014
rfsd
- Messages postés
- 7
- Date d'inscription
- mercredi 19 novembre 2014
- Statut
- Membre
- Dernière intervention
- 20 novembre 2014
A voir également:
- Comment créer un login
- Etape pour creer login et mot de passe - Forum - Webmaster
- Comment créer un login utilisateur ? ✓ - Forum - Créer un site
- Créer un formulaire login à l'ouverture d'une base de données ✓ - Forum - Access
- Créé un login ✓ - Forum - Jeux en ligne: Minecraft
- Créer un login et mot de passe ✓ - Forum - Programmation
2 réponses
f894009
- Messages postés
- 15519
- Date d'inscription
- dimanche 25 novembre 2007
- Statut
- Membre
- Dernière intervention
- 16 janvier 2021
Bonjour,
c'est ecrit:
The drop-down list sources the information using an SQL command:
Propriete: de la Zone de liste deroulante (ComboBox) ou vous choisissez le nom de connexion
donnees, contenu
et
source de controle: nom du champ employes
c'est ecrit:
The drop-down list sources the information using an SQL command:
Propriete: de la Zone de liste deroulante (ComboBox) ou vous choisissez le nom de connexion
donnees, contenu
et
source de controle: nom du champ employes
f894009
- Messages postés
- 15519
- Date d'inscription
- dimanche 25 novembre 2007
- Statut
- Membre
- Dernière intervention
- 16 janvier 2021
Bonjour,
a voir:
https://access.developpez.com/faq/?page=TAAdmin#login
plus complet mais en anglais
http://www.databasedev.co.uk/login.html
a voir:
https://access.developpez.com/faq/?page=TAAdmin#login
plus complet mais en anglais
http://www.databasedev.co.uk/login.html
rfsd
- Messages postés
- 7
- Date d'inscription
- mercredi 19 novembre 2014
- Statut
- Membre
- Dernière intervention
- 20 novembre 2014
je vennais de créer la table des Utilisateurs et formulaire Logon, maintenant je ne sais où introduire la commande SQL
SELECT [tblEmployees].[lngEmpID], [tblEmployees].[strEmpName]
FROM tblEmployees;
C'est dans quelle Contrôle ? et quelle est la procédure
Pour le code:
Private Sub cboEmployee_AfterUpdate()
'After selecting user name set focus to password field
Me.txtPassword.SetFocus
End Sub
et
pour le code:
Private Sub cmdLogin_Click()
'Check to see if data is entered into the UserName combo box
If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmployee.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", _
"[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "frmLogon", acSaveNo
DoCmd.OpenForm "frmSplash_Screen"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.txtPassword.SetFocus
End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If
End Sub
Merci pour l'aide
SELECT [tblEmployees].[lngEmpID], [tblEmployees].[strEmpName]
FROM tblEmployees;
C'est dans quelle Contrôle ? et quelle est la procédure
Pour le code:
Private Sub cboEmployee_AfterUpdate()
'After selecting user name set focus to password field
Me.txtPassword.SetFocus
End Sub
et
pour le code:
Private Sub cmdLogin_Click()
'Check to see if data is entered into the UserName combo box
If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmployee.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", _
"[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "frmLogon", acSaveNo
DoCmd.OpenForm "frmSplash_Screen"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.txtPassword.SetFocus
End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If
End Sub
Merci pour l'aide
je reviendrai à vous après exécution de la procédure
Merci et courage