BenSacheri
Programmer
thread702-1716817
thread702-1765353
These two threads are closed for the awesome FindAsYouTypeListBox and FindAsYouTypeCombo classes created by MajP but I wanted to share this small addition.
If you open and close the form that uses this class too many times, Access may crash unless you've remembered to add code to terminate the class. You can add these two bits to your code and the class will self-terminate. It works because the class already has a reference to the parent form, so it can monitor the Form_Close event on the form and terminate the class when it fires.
In the Initalize() (or InitalizeFilterCombo) sub, add this OnClose line below the exiting OnCurrent line:
Then add this sub:
Please share some feedback if you are using either of these classes. I have made a few other changes but don't want to waste my time if no one is using them.
Ben
thread702-1765353
These two threads are closed for the awesome FindAsYouTypeListBox and FindAsYouTypeCombo classes created by MajP but I wanted to share this small addition.
myself said:If you don't know about the FindAsYouTypeListBox class, it will let you have a textbox above a listbox. As you type into the textbox, the listbox will automatically filter, like an Autocomplete list. This class can be applied to any existing listbox with only a few lines of code.
The FindAsYouTypeCombo will convert a combo box into a Autocomplete style box that will shorten the list to match the letters you type.
These both work in memory so and don't need to requery the server with each filter.
If you open and close the form that uses this class too many times, Access may crash unless you've remembered to add code to terminate the class. You can add these two bits to your code and the class will self-terminate. It works because the class already has a reference to the parent form, so it can monitor the Form_Close event on the form and terminate the class when it fires.
In the Initalize() (or InitalizeFilterCombo) sub, add this OnClose line below the exiting OnCurrent line:
Code:
mForm.OnCurrent = "[Event Procedure]" ' below this line
mForm.OnClose = "[Event Procedure]" ' <- this is the new line
Then add this sub:
Code:
Private Sub mForm_Close()
' By tapping into the form events FROM this class, I can tap into the Close event
' so I don't need to have the cleanup code in the form. "Cleaner" this way I think. -TSC
Call Class_Terminate
End Sub
Please share some feedback if you are using either of these classes. I have made a few other changes but don't want to waste my time if no one is using them.
Ben