CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: String Search

Threaded View

  1. #1
    Join Date
    Jan 2005
    Posts
    9

    Question String Search

    Hi

    We have a list of alpha-codes for families in a recordset that needs to be reduced given an alpha-code range, for example 'B' through 'M' or 'CA' to 'CS' or 'SAC' to SAX' or combinations of these three options. The user can use up to three characted for both the start and end parameters.

    The current code is in VB for applications in Access 97 :
    Set trst = db.OpenRecordset("SELECT * " & _
    "FROM tbl_Display " & _
    "WHERE ((tbl_Display.QCode)>=[Forms]![frm_Settings]![txt_Start_Char] " & _
    "AND (tbl_Display.QCode)<=[Forms]![frm_Settings]![txt_End_Char])", dbOpenDynaset)

    If the users enters Start Character = 'A' and End Character = 'A' the recordset returns no records even thought there may be 6 records starting with 'A'. If the start and end are 'A' and 'B' it returns only the 'A' records etc.

    Any suggestions of how to code or why would be appreciated.
    Last edited by Steve@GIHS; September 2nd, 2005 at 12:21 AM. Reason: PRovide more details about problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured