Results 1 to 2 of 2
  1. #1
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75

    Exclamation User and pass form

    Can some one help me solve the User Name and password form..

    I have a table which has three columns ID, Employee and Password (with the same name)

    I have form with two texts and one button.

    Text one is user name (named EMP)
    Text 2 is password (name PASS)

    The table is tblEmployees

    I used the code builed and inserted the following code for checking for the user and pass..




    "

    If Me.PASS.Value = DLookup("Password", "tblEmployees", "[Employee]=" & Me.EMP.Value) Then

    DoCmd.Close acForm, "UserPassForm", acSaveNo
    DoCmd.OpenForm "Data"

    End If"

    But the code is returning the error as

    "The expression you entered as a query parameter produced this error : "Hitesh" (one of the usernames i inputed)



    help me....!!!! PLEASE

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Hitesh is text, text must be enclosed in apostrophe delimiters (dates would be #), like:
    DLookup("Password", "tblEmployees", "[Employee]='" & Me.EMP.Value & "'")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. pass value from one form to another
    By ManC in forum Forms
    Replies: 7
    Last Post: 11-25-2011, 09:59 AM
  2. Replies: 4
    Last Post: 04-22-2011, 03:08 PM
  3. Pass Value to Form
    By JohnBoy in forum Programming
    Replies: 5
    Last Post: 06-06-2010, 11:26 AM
  4. Pass a value from a query to a form
    By cwwaicw311 in forum Forms
    Replies: 22
    Last Post: 03-22-2010, 10:21 AM
  5. Pass a value from a form to another
    By cwwaicw311 in forum Forms
    Replies: 3
    Last Post: 03-16-2010, 12:42 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
  •  
Other Forums: Microsoft Office Forums