Results 1 to 4 of 4
  1. #1
    shah1419 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    30

    Search Text instead of number

    </Code>
    Private Sub Combo238_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[GR No] = " & Str(Nz(Me![Combo238], 0))


    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub
    <code\>

    this query find the number in unbound combo box...like 34, 56, 78, 89
    but when i want to search 13mt-01 it gives me error:
    how i can find the text like in marron color....

  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
    Have a look at Daniel's response where you double-posted the question:

    http://www.utteraccess.com/forum/Sea...-t2009528.html

    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
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    If [GR no] is a text field, you might try putting single-quotes around your search:
    Code:
    rs.FindFirst "[GR No] = '" & Str(Nz(Me![Combo238], 0)) & "'"
    If it's a number field, then that value can never be found there.

  4. #4
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    Code:
    Private Sub Combo238_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[GR No] = '" & Me.Combo238 & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub

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

Similar Threads

  1. Replies: 3
    Last Post: 09-02-2013, 04:33 PM
  2. Replies: 9
    Last Post: 03-22-2013, 06:37 AM
  3. convert number to text number like in cheque
    By ravideep in forum Reports
    Replies: 1
    Last Post: 03-12-2013, 05:55 AM
  4. Replies: 2
    Last Post: 07-21-2012, 01:21 AM
  5. Replies: 3
    Last Post: 05-29-2012, 04:47 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