Mouse Wheel Trouble (1 Viewer)

Soulium

Registered User.
Local time
Today, 00:47
Joined
Sep 9, 2008
Messages
57
So I am trying to use this MouseHook.dll from http://www.lebans.com/mousewheelonoff.htm and am having trouble. I have put the .dll in my database directory (which is on a public folder) and have imported the module from the sample database I have also copied the code for the Mouse Wheel so it’s set to off in the OnLoad Event for the form. Well it’s not working. I have heard that you may need to make a reference to where the .dll file is but I’m not too good with vba - if this is the case could someone tell me where to put the reference in and how the code looks?

Thanks, Matt.
 

Bodisathva

Registered User.
Local time
Yesterday, 19:47
Joined
Oct 4, 2005
Messages
1,274
Code:
Dim strPath as String

strPath = "x:\xxxxxx\xxxxxx\xxxx.dll"
Application.References.AddFromFile strFullPath

If someone else is going to run the db, they will also need the .dll referenced by the code (or you will need to appropriately trap and handle the ensuing error).

As another option, you may want to look at VBScroll and run it at startup.
 

Soulium

Registered User.
Local time
Today, 00:47
Joined
Sep 9, 2008
Messages
57
Thanks for your help :)

Still not got it working :S Should i put that in the module somewhere?

Sorry for being a bit slow.

Thanks again, Matt.
 
Last edited:

Bodisathva

Registered User.
Local time
Yesterday, 19:47
Joined
Oct 4, 2005
Messages
1,274
Have a switchboard? A main form? Placing this code in the On_Open event of either should do the trick.

If that fails, you could also place the code in a module and use the RunCode command from an AutoExec macro.
 

Steve R.

Retired
Local time
Yesterday, 19:47
Joined
Jul 5, 2006
Messages
4,704
It works for me (Access 2000), below is a copy of the "Form_Open" event. All the rest of the code is in a module as a function.

Code:
Public Sub Form_Open(Cancel As Integer)
    On Error GoTo ERR_FormOpen
    Rem MsgBox "Form Open Occured"
    Rem Set initial parameters before opening form
  [B]  [SIZE="4"]Dim blRet As Boolean
   blRet = MouseWheelOFF(True, False)[/SIZE][/B]
    Set CDBS01 = CurrentDb
    Set CRST01 = CDBS01.openrecordset("select * from projectnumqry where [status]<10", dbOpenDynaset)
    Set Me.Recordset = CRST01
    FormNamestr = Me.Name
    Set Forms(FormNamestr).Recordset = CRST01
    Call SetControlFormat
    Call DatabaseColors
    [List7].Selected(1) = True
    Me.List7.BorderColor = Borderclr
    If Application.CommandBars("Menu bar").Enabled Then
            Me.Command270.Caption = "Toolbars OFF"
        Else
            Me.Command270.Caption = "Toolbars ON"
        End If
    Exit Sub
ERR_FormOpen:
    MsgBox Err.Description
    Exit Sub
End Sub
 

Soulium

Registered User.
Local time
Today, 00:47
Joined
Sep 9, 2008
Messages
57
Ok this is really weird.

I'll open the form and I’ll be able to scroll through the records but as soon as I click a record on the form or change to a different tab it suddenly works. I do have sub forms on this form could they be causing the problem?

Edit:

Its ok. solved the problem by setting a focus up.

Thanks for your help :D You both rock! :D
 
Last edited:

MaliciousMike

Registered User.
Local time
Today, 00:47
Joined
May 24, 2006
Messages
118
Now I have an issue with this if someone could help.

I have a form with one subform. The mousehook.dll aproach is working and not allowing a user to scroll through records. And on the main form, it is allowing people to scroll through memo text boxes.
However, on my subform, it's not allowing users to scroll in the memo text boxes (there's several...).

I've tried MouseWheelOFF(False), MouseWheelOFF(True) and both the same again in the subform's OnLoad event, however nothing seems to be working.
Is there a known bug with this?

Any help would be greatly appreciated!
 

Users who are viewing this thread

Top Bottom