Find first syntax when it is a string.

Posted on 2005-04-27
Last Modified: 2008-02-20

I am getting error

Private Sub Combo3_AfterUpdate()
Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[CaseNumber] = " & Str(Me![Combo3])
    Me.Bookmark = rs.Bookmark
End Sub

I am getting data type mismatch error at line.

rs.findfirst "[Casenumber] = " & Str(Me![Combo3])

the Casenumber described is a textfield.


Question by:bnaidu
    1 Comment
    LVL 65

    Accepted Solution

    >the Casenumber described is a textfield.
    In that case you need to delineate the value with single quote marks.

    rs.findfirst "[Casenumber] = '" & Str(Me![Combo3]) & "'"

    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.

    Suggested Solutions

    Introduction: Often, when running a query with joins, the results show up "duplicates", and often, those duplicates can be "eliminated" in the results using DISTINCT, for example. Using DISTINCT is simple: just add it after the SELECT keyword, an…
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    794 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

    18 Experts available now in Live!

    Get 1:1 Help Now