bodylojohn
Registered User.
- Local time
- Today, 14:06
- Joined
- Dec 28, 2005
- Messages
- 205
Hello,
I have a login form containing just a combobox (login name) and a textfield (password). Well...this works perfect using the following code:
BUT...
I want to replace the combobox with a textbox so the user has to type his username.
I tried some changing the code but without success. I could find a lot of info on the board but saddly they where all using combo boxes.
Thanks in advance guys.
I have a login form containing just a combobox (login name) and a textfield (password). Well...this works perfect using the following code:
Code:
Private Sub cmdLogin_Click()
If IsNull(Me.cboLoginNaam) Or Me.cboLoginNaam = "" Then
MsgBox "Selecteer een gebruikersnaam!", vbOKOnly, "Gebruikersnaam vereist"
Me.cboLoginNaam.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.txtWachtwoord) Or Me.txtWachtwoord = "" Then
MsgBox "U dient een wachtwoord in te voeren!.", vbOKOnly, "Voer wachtwoord in"
Me.txtWachtwoord.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.txtWachtwoord.Value = DLookup("Wachtwoord", "tblGEBRUIKER", _
"[Gebruiker_ID]=" & Me.cboLoginNaam.Value) Then
Gebruiker_ID = Me.cboLoginNaam.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "frmLogin", acSaveNo
DoCmd.OpenForm "frmRELATIE_ZOEKSCHERM"
Else
MsgBox "Wachtwoord is ongeldig. Probeer het nogmaals", vbOKOnly, _
"Invalid Entry!"
Me.txtWachtwoord.SetFocus
End If
End Sub
BUT...
I want to replace the combobox with a textbox so the user has to type his username.
I tried some changing the code but without success. I could find a lot of info on the board but saddly they where all using combo boxes.
Thanks in advance guys.