MouseWheel Disabled sometimes

teel73

Registered User.
Local time
Today, 09:14
Joined
Jun 26, 2007
Messages
205
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:

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.
 
I'm wondering if the SendKeys is causing you an issue. Why are you using SendKeys anyway? What is it you are trying to accomplish with using that?
 
I'm not sure why I'm using the send keys to the ESC key. Let me research that. I'll remove it to see if that is the problem.
 
I'm not sure why I'm using the send keys to the ESC key. Let me research that. I'll remove it to see if that is the problem.


OK .. so now I have placed the code on the onLoad event of the form and when I open my form i get the attached error message about not finding the MouseHook.dll. But the .dll is in the same folder as the .mdb. I don't understand why it's not working.
 

Attachments

  • ErrorMsg.png
    ErrorMsg.png
    8.8 KB · Views: 101

Users who are viewing this thread

Back
Top Bottom