I have a DLookup that finds a customer number in the customer table where the Name of the customer is like a value typed in a text field. The form takes the result of the DLookup and selects a value in a listbox. For example, if I type in the text box "Johns", in the listbox below my text box, the first matching customer name beginning with Johns will be selected ... maybe "Johnson". The listbox contains tens of thousands of names, so a method is needed to jump to a logical place in the list.
What I want to do is to find the next closest value when there is not a matching value. If there are no customers whose names are like (start with) "Johns", then I want to move to the next customer name on the list. In real life, that next name might be "Kempher".
Can anybody point me in the right direction? I have tried doing a different DLookup or a DMin, but I'm not getting there.
MrsBean
What I want to do is to find the next closest value when there is not a matching value. If there are no customers whose names are like (start with) "Johns", then I want to move to the next customer name on the list. In real life, that next name might be "Kempher".
Can anybody point me in the right direction? I have tried doing a different DLookup or a DMin, but I'm not getting there.
MrsBean