By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Stephen Lebans MouseHook.dll

P: 7
When having two ms Access databases open, the mousehook setting from one database controls the setting in the second database.
Is there any way of keeping the two completely separate and allowing them to operate independently within its own database

Thanks
Avellano
Jun 14 '07 #1
Share this Question
Share on Google+
3 Replies


DeMan
100+
P: 1,806
Moving to Accwess Forum for you.....Thanks for advising
Jun 14 '07 #2

P: 7
Moving to Accwess Forum for you.....Thanks for advising
Hi all
Have worked around the issue as follows:
When opening a database I set the following:

gstrAction = "Set Reference to MouseWheel"
gbMouseOnOff = MouseWheelOFF
gbMouseOnOff = MouseWheelON

Each form that can be scrolled trough (Not continous forms) have the following two sub routines:
Private Sub HookOn()
gstrAction = "Reattach Form to MouseWheel"
gbMouseOnOff = MouseWheelON

DoCmd.RunSQL ("UPDATE tblADMISecurity " _
& "SET tblADMISecurity.secuHook ='On' " _
& "WHERE tblADMISecurity.secuUser = '" _
& gstrCurrUser & "';")
End Sub

Private Sub HookOff()
gstrAction = "Setting Mousewheel"
gbMouseOnOff = MouseWheelOFF(False)

DoCmd.RunSQL ("UPDATE tblADMISecurity " _
& "SET tblADMISecurity.secuHook ='Off' " _
& "WHERE tblADMISecurity.secuUser = '" _
& gstrCurrUser & "';")
End Sub

Then on Add or Edit I run the following:

gstrAction = "Check if this User is Editing anything"
strHook = NZ(DLookup("secuHOOK", "tblADMISecurity" _
, "secuUser = '" & gstrCurrUser & "'"))

If strHook = "On" Then

strUserName = NZ(Me!recLockedBy)
If strUserName = gstrCurrUser Or Len(strUserName) = 1 Then

Call HookOff

Me!recLockedBy = gstrCurrUser

frmState = 1
SetForm Me

Me.Refresh

Me!acroDescription.SetFocus

Else
MsgBox "This Record is Locked by " & strUserName, _
vbExclamation, "Locking Message"

End If
Else
MsgBox "Hola, " & gstrFirstName _
& vbCrLf & "You are already working in another Form" _
& vbCrLf & "On another Record" _
& vbCrLf & "Please try to keep things tidy" _
, vbInformation, ErrMsgHelp

End If

On Save or Form Close I reset the Mouse Hook:

Call HookOn

It may not be elegant, but it works. I have 7 applications running with about 40 users.

Regards

Avellano
Jun 20 '07 #3

P: 8
I have also encountered a problem with the Leban's fix.

During the process of developing a DB, I installed the fix and it worked fine for quite some time. I have continued to work on the DB, adding a form here, a function (like keyword search), but nothing that drastically altered the design of the DB. Then one day, it just stopped working. I've re-installed the moduel but no use.

I am running the DB from a network folder on my company's network. The mousehook.dll file that comes from Leban's DB file is also installed in that folder.

The first form that loads has this code:

Private Sub Form_Load()
' Turn off Mouse Scroll
Dim blRet As Boolean
blRet = MouseWheelOff
End Sub


I also tried Leban's original "on/off" button version, as below:

Private Sub MouseWheelOff_Click()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOff
End Sub

NOTE: When I attempted using the button, I received the error message: "Run time error '438': Object doesn't support this property or method."


Any thoughts as to why this may have stopped functioning?
Jul 9 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.