|
-
Jun 3rd, 2005, 06:58 AM
#1
Thread Starter
Member
[RESOLVED] Invalid Use of Null !
Hi All,
I am using following code written on a button click event on a user Login form in Access-2003 VBA.
Code -----------------------------------------------------
Private Sub cmdLogin_Click()
'Login procedure
Dim PasswordData As String
LoginName = txtUserName
Password = txtUserPass
PasswordData = DLookup("[UserPass]", "tbuser", "[UserName] = forms!Login!txtusername")
'PasswordData = DLookup("[UserPass]", "tbUser", "[UserName] = Login")
If Password = PasswordData Then
Call LoginFunction
Else
MsgBox "Sorry, your username or password was incorrect." & vbCrLf & vbCrLf & "Unable to login.", vbCritical, "Login Error"
End If
End Sub
-----------------------------------------Code
I have a table named tbUser and fields UserName, UserPass and UserPrev in this table. I want to get Passworddata where login Name match with any record in the table. When control comes to DLookup function an error Invalid Use of Null is raised. I can't guess what is the problem.
Anyone please help.
Alankar
Last edited by Alankar; Jun 20th, 2005 at 12:33 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|