Results 1 to 2 of 2

Thread: Finding in database (ADODC)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    115
    Ok. What I need is in my text box auto-mapped on to the ADODC's Name field, is when you start typing a name, it automatically finds the record nearest it (after it not before) and put it in an array or whatever (and also remember the recnum duh). So that way if my database had like 50 names, I could press the letter "S" and my two boxes would show:
    s
    Samson, John

    then I press the next letter "m"
    sm
    Smith, Jack

    and so on.

    What would also be nice would be a search. For example, I type in the search box a word, and it goes through each record looking for that word in the comment field and if it has it it stops there. This is easily doable with stepping through each record and doing a for i=1 to len(comments)-len(search), and doing a mid with i each loop, but I was just wondering if there was a better way.

    So there you go. PLEASE REPLY!
    Vuen

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    60
    Try the find method, but don't use an equal operator, rather try the LIKE operator. ie:
    ADODC.Recordset.Find "<fieldname> LIKE '" & Text1.Text & "*'"
    Barend
    JHB-SA

    Nothing is impossible, except skiing through a revolving door.

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