By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,248 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,248 IT Pros & Developers. It's quick & easy.

RunTime error: 3075 - Dlookup Issue dealing with login security

P: 1
Here is the code that keeps erroring out.
Expand|Select|Wrap|Line Numbers
  1.     If (IsNull(DLookup("EmployeeID", "tbl_EmployeeData", "EmployeeID = '" & Me.txtEmployeeID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
  2.             MsgBox "Invalid UserName or Password!"
  3. Else
  4.         'Verifying the User Security
  5.         UserLevel = DLookup("User Level", "tbl_EmployeeData", "Employee ID = '" & Me.txtEmployeeID.Value & "'")
3 Weeks Ago #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 31,419
You have two lines which contain DLookup() calls but don't make clear which is the one with an issue - or even if both do.

Well, I don't know about line #1, which looks messy enough, but line #5 will certainly fail as you've referred to a field called Employee ID which has a space in it. Either remove the space from the field name or surround it with brackets ([]) in order to convert it to proper SQL format. IE [Employee ID].
3 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.