Results 1 to 5 of 5
  1. #1
    leskoms is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    2

    Code for 2010 not working in 2013

    I am typing the following code in vba access 2013:

    If (IsNull(DLookup("Username", "tblUser", "Username ='" & Me.txtUsername.Value & "'"))) Or
    (IsNull(DLookup("Password", "tblUser", "Password ='" & Me.txtPassword.Value & "'"))) Then
    MsgBox "Username or Password is Incorrect"

    But it is not taking it, however this statement works perfectly in access 2010. It appears that it is not taking "Or" as an operator. What can I do?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by leskoms View Post

    Code for 2010 not working in 2013
    Does any code run? If not, when you installed the new version, did you declare the folder holding the file as 'Trusted?'

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    leskoms is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    2
    I am recreating the database using the same codes, but in 2013 version. All of the other codes are recognized, it seems like this is the only part that doesnt want to take

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Are you getting any error messages??

    If so, what is the error message?

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by leskoms View Post
    ....appears that it is not taking "Or" as an operator....
    So if you create two If Then Statements, one for each DLookup, the code works?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 12-04-2014, 12:47 PM
  2. 2007, 2010 or 2013.
    By Paul H in forum Access
    Replies: 4
    Last Post: 02-14-2014, 09:32 AM
  3. Using Labels in Reports in Access 2013 and 2010
    By MillerRL143 in forum Reports
    Replies: 3
    Last Post: 08-08-2013, 09:12 PM
  4. Replies: 2
    Last Post: 06-18-2013, 09:06 AM
  5. Replies: 6
    Last Post: 01-24-2013, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums