I have no idea why the disabled mousewheel function works fine when I load the form but as soon as I click on my listbox to find a specific record on my form the mousewheel in back enabled. Don't know what's going on. Can someone please help me with this problem. Here is the code I have on OnLoad of the form:
Then I have a listbox on that form with the following code:
When I load my form, the mousewheel is disabled just fine. After I double click on my listbox to find a specific record, then the mousewheel is enabled again.
Code:
' Turn the MouseWheel Off
Dim blRet As Boolean
' Call our MouseHook function in the MouseHook dll.
' Please not the Optional GlobalHook BOOLEAN parameter
' Several developers asked for the MouseHook to be able to work with
' multiple instances of Access. In order to accomodate this request I
' have modified the function to allow the caller to
' specify a thread specific(this current instance of Access only) or
' a global(all applications) MouseWheel Hook.
' Only use the GlobalHook if you will be running multiple instances of Access!
blRet = MouseWheelOFF(False)
Then I have a listbox on that form with the following code:
Code:
Private Sub lstentries_DblClick(Cancel As Integer)
Dim ctlList As Control, varItem As Variant
Dim myId As Integer
Dim xx As Integer
' Return Control object variable pointing to list box.
Set ctlList = Forms!frmSCC_Blotter_Input![lstentries]
x = ctlList.ItemsSelected(0)
xx = ctlList.ItemData(x)
SendKeys "{ESC}"
DoEvents
DoCmd.GoToControl "ID"
DoCmd.FindRecord xx
End Sub
When I load my form, the mousewheel is disabled just fine. After I double click on my listbox to find a specific record, then the mousewheel is enabled again.