Results 1 to 5 of 5

Thread: Quick find on Access database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    I have a large database with a query containing name (40 characters) and ID (6 characters). I want to be able to do a quick find by typing in the name (or parrt of the name) whcih will display all those starting with the characters typed and the associated IDs. Then wehn you double-click on the name selected you can read in the relevant record using its ID code. If I populate a text box with name and ID it takes 15 seconds as there are 6000 records. Any ideas?

  2. #2
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232

    Post

    Do you use SQL or recordset.find method to query the 6000 records?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    I am reading from an Access query and have tried to populate the text box using recordset.Findnext and text1.Additem. If I use a dropdown combo then I can only display one field at a time.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    I am reading from an Access query and have tried to populate the text box using recordset.Findnext and text1.Additem. If I use a dropdown combo then I can only display one field at a time.

  5. #5
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232

    Post

    Does your code scheme look anything like this? (cmdSearch is a commandbutton that does the initial search, text1 is where user types the name, SomeList is the list control you use):
    Code:
    private sub cmdSearch_Click()
       set rs = db.openrecordset( _
              "SELECT name, id FROM table "
            & "WHERE name LIKE '" & text1.Text & "*'")
       '(thus the query returns just those names that matches the typed string, not all 6000)
    end sub
    
    private sub SomeList_Dblclick()
    
       rs.find ("id=" & CurrentID)
       'the find only search a limited amount of records
    
    end sub
    if not, maybe you could try this scheme

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