Consulting

Results 1 to 2 of 2

Thread: Combobox with many records, update rowsource doesn't return expected values

  1. #1
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399

    Combobox with many records, update rowsource doesn't return expected values

    so I have two combo boxes that I am using to make selections from a table containing 76,000 + records

    I have created and on change event to update the rowsource after the user types a few letters to reduce the selection down to a managable number and keep system speed up.

    Private Sub FilterText_Change()
    If Len(Me.FilterText.text) >= 3 Then
        Me.FilterText.RowSource = "SELECT DISTINCT NONPROPRIETARYNAME FROM tblNDCList WHERE NONPROPRIETARYNAME like '" & Me.FilterText.text & "%' ORDER BY NONPROPRIETARYNAME"
    End If
    End Sub
    However if I type in Aceta into the combo box I expect it to show everything that starts Aceta in that field however it only shows a single return Acetagesic

    however if I add one more letter and make it Acetam it correctly brings up a list of 40 or so items that match that as a start of Acetaminophen

    but why does it not show correctly the first time.... ?

    (for those wondering yes this is a list of medications).

    If I try and set the field to re query after I change the rowsource it gives me an error about saving (even though the field is unbound) and the fact that it DOES update the list shows that it shouldn't be necessary
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  2. #2
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    So the issue I realized after posting here is that using me.filterText.text not only came back with the text that had been typed in BUT if the system had found a close match (Auto Expand) it was including that text too...

    as such turning off Auto Expand has resolved the problem and is providing the functionality that we are after, we will just have to re educate our users slightly on the work flow difference.
    Last edited by SamT; 01-20-2015 at 11:06 AM.
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

Posting Permissions

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