Results 1 to 4 of 4

Thread: [RESOLVED] Multi field search for mdb

  1. #1

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Resolved [RESOLVED] Multi field search for mdb

    Guys, really I am tired for trying to solve this:
    I want to make an only textbox that if u type the keyword the datagrid will filter the search result from mdb.
    I am glad to receive ur help

    T&R,

    VH
    Sorry for my bad english, You may correct my english if there is any mistake.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Multi field search for mdb

    Build sql string first:

    sqlSearch = "select from Table1 where Field1 like '%" & Text1.Text & "%' or Field2 like '%" & Text1.Text & "%'"

    ...then open recordset based on that sql.


    Or something of that nature should work... however you didn't even explain what you need so my reply is based on your thread title.

  3. #3

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Multi field search for mdb

    Thanks Rhinobull u solved my problem

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: [RESOLVED] Multi field search for mdb

    Be careful though. The characters %, _, #, [, ], and - all have special meaning within patterns. If the user enters any of these it may produce undesired results.

    One fix might be to replace any of these characters in the user's input with _ (underscore, i.e. "match any one character"). Another might be to scan for these and reject the operation with an error message if found.

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