MajP
You've got your good things, and you've got mine.
- Local time
- Today, 15:16
- Joined
- May 21, 2018
- Messages
- 8,527
No big deal I just found it strange that you changed it after I put a big foot stomping comment.MajP, i'm trying. Sorry, this is a new concept for me.
Code:
Const CharacterMin = 3
'MUST Be a module level variable as per Allen Browne
Dim sProductStub As String
How big is big? Lets say this list is less than 10000, then it may be simpler to just do a straight Filter/find as you type. I use a class module, but you can write some simple code. It is not an efficient method if you have 100k or more records or if the backend is on SQL. You would want to do something more like this where you first apply the filter before pulling any records vs starting with all the records and then narrowing it down.
See new subform
The reason for the class module is reuseability. Once you import the class module you never change the code, you just instantiate the class. Here is the entire code on the form to make this work. It would be the same for any other combo. Always just one line of code. Also you can change it to search anywhere in the string or any number of fields by changing the arguments.
Code:
Private FAYT_Part As New FindAsYouTypeCombo
Private Sub Form_Load()
FAYT_Part.InitalizeFilterCombo Me.cmboProductID, "PM_Part_Number", FromBeginning
End Sub