Access 2003.  Syntax for FindFirst

Posted on 2007-08-07
Last Modified: 2008-01-09
Access 2003.  Sntax for FindFirst.  [Username] and [Password] are fields in the table tblLogin.  
struserName and strPassword are captured from the Form using strUserName = Me......

The following syntax does not work.  Can someone please correct it.  Thanks.

Set db = CurrentDb
        Set RS = db.OpenRecordset("tblLogin")
        RS.FindFirst "[Username] =  '" & strUserName & "'" & "[Password] = '" & strPassword & "'"
Question by:jegajothy
    1 Comment
    LVL 61

    Accepted Solution

    RS.FindFirst "[Username] =  '" & strUserName & "' AND " & "[Password] = '" & strPassword & "'"
                                                                                       ^--- Add this

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now