I have a form in Access 2007 with many listbox controls on it. I want to run a certain routine that does something with the highlighted value in the listbox whenever any of them are double clicked. But it does not work.
I created a class that is supposed to handle this. Very simplified, and named "clsMyClass ", it looks like this:
To demonstrate the problem, I created a form with a listbox named "List5" to use the class to handle it:
This does not work: when I double-click the List5 control, "MyRoutine" does not run. However, it does run if I define the DblClick event in the form -- even without anything in it, i.e.:
Can anyone explain this? Is there any way around this? Thanks for your help on this ...
--bobkohn
I created a class that is supposed to handle this. Very simplified, and named "clsMyClass ", it looks like this:
Code:
Private WithEvents lstThisBox As Access.ListBox
Public Property Set ThisList(ByRef lst As Access.ListBox)
Set lstThisBox = lst
End Property
Private Sub lstThisBox_DblClick(Cancel As Integer)
Call MyRoutine(lstThisBox)
End Sub
Code:
Private clsListBox As clsMyClass
Private Sub Form_Load()
Set clsListBox = New clsMyClass
Set clsListBox.ThisList = Me.List5
End Sub
Code:
Private Sub List5_DblClick(Cancel As Integer) End Sub
--bobkohn
Comment