rashidzaib
Registered User.
- Local time
- Today, 11:55
- Joined
- Aug 12, 2007
- Messages
- 32
hy bro and sis
i am facing problem in login form
i have created on form based on table user have field name and password
actualy when i open then form the first record in table is appearing in form.
also when i am entering the first record of user name and password it is proceding the other user name password is not working. and third problem when i am entering the user name and password it is actually updating the first record. can any one sole my problem. this is my third post in this forum and i am not been able to find any good reply. i am new to access. i have oracle experince.
my code is given below
Private Sub CMDLOGIN_Click()
Me.CMDLOGIN.SetFocus
Dim USERNAME As String
Dim Flag As Boolean
Flag = False
If IsNull(Me.USERNAME) Or Me.USERNAME = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.USERNAME.SetFocus
Exit Sub
End If
If IsNull(Me.PASSWORD) Or Me.PASSWORD = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.PASSWORD.SetFocus
Exit Sub
End If
USERNAME = DLookup("[USERNAME]", "USERTABLE")
If Me.PASSWORD.Value = DLookup("[PASSWORD]", "USERTABLE") Then
DoCmd.Close acForm, "USERTABLE1", acSaveNo
DoCmd.OpenForm "JAWDAH"
Do Until Flag = True
If Me.PASSWORD <> DLookup("PASSWORD", "USERTABLE") Then
Flag = False
Else
Flag = True
End If
Loop
Else
MsgBox "The Password You Entered Is Invalid. Please Try Again", vbOKOnly, "Invalid Password"
Me.PASSWORD.SetFocus
End If
End Sub
Private Sub CMDLOGIN_Exit(Cancel As Integer)
End Sub
Private Sub PASSWORD_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
CMDLOGIN_Click
End If
End Sub
Private Sub USERNAME_Enter()
End Sub
Private Sub USERNAME_Exit(Cancel As Integer)
End Sub
any response should realy be appriciated.
very dishearted but still waiting for reply
i am facing problem in login form
i have created on form based on table user have field name and password
actualy when i open then form the first record in table is appearing in form.
also when i am entering the first record of user name and password it is proceding the other user name password is not working. and third problem when i am entering the user name and password it is actually updating the first record. can any one sole my problem. this is my third post in this forum and i am not been able to find any good reply. i am new to access. i have oracle experince.
my code is given below
Private Sub CMDLOGIN_Click()
Me.CMDLOGIN.SetFocus
Dim USERNAME As String
Dim Flag As Boolean
Flag = False
If IsNull(Me.USERNAME) Or Me.USERNAME = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.USERNAME.SetFocus
Exit Sub
End If
If IsNull(Me.PASSWORD) Or Me.PASSWORD = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.PASSWORD.SetFocus
Exit Sub
End If
USERNAME = DLookup("[USERNAME]", "USERTABLE")
If Me.PASSWORD.Value = DLookup("[PASSWORD]", "USERTABLE") Then
DoCmd.Close acForm, "USERTABLE1", acSaveNo
DoCmd.OpenForm "JAWDAH"
Do Until Flag = True
If Me.PASSWORD <> DLookup("PASSWORD", "USERTABLE") Then
Flag = False
Else
Flag = True
End If
Loop
Else
MsgBox "The Password You Entered Is Invalid. Please Try Again", vbOKOnly, "Invalid Password"
Me.PASSWORD.SetFocus
End If
End Sub
Private Sub CMDLOGIN_Exit(Cancel As Integer)
End Sub
Private Sub PASSWORD_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
CMDLOGIN_Click
End If
End Sub
Private Sub USERNAME_Enter()
End Sub
Private Sub USERNAME_Exit(Cancel As Integer)
End Sub
any response should realy be appriciated.
very dishearted but still waiting for reply