473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Stephen Lebans MouseHook.dll

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
3 2797
DeMan
1,806 1GB
Moving to Accwess Forum for you.....Thanks for advising
Jun 14 '07 #2
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
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

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

Similar topics

2
by: Wally | last post by:
Hi All, I'm using Stephan Lebans' nifty code for automatically resizing text fields to the size required to show (almost) all text in that field (CanGrow3, thanks Stephen!). In general this...
11
by: Patrick | last post by:
I am using Stephans code to change the background color of the Access container in Access 97, the code works fine when running in Access in the normal way. The problem occurs when running the...
1
by: Alex | last post by:
The JustiDirect text justification on Stephen LeBans site works well but I cannot get it to work on a sub report. Could anyone tell me if this is possible. Thanks. Alex
3
by: Alex Wisnoski | last post by:
I am trying to adapt Lebans' ReportUtilities to export reports (to preserve formatting) from an Access 97 application. I have made the reference to his mde and copied the modules into my db. I...
4
by: Karl Roes | last post by:
Hi Stephen, Very Cool. I can only get it working on the first row of a continuous form. Is this correct? Regards Karl
3
by: Phil Stanton | last post by:
I am trying to produce a program that will output any Access report to an editable Word document. So far it is working well but slowly with text boxes, labels, and lines. I now need to try to...
3
by: Rémi | last post by:
Hello all! I've been using Stephen Lebans' MouseWheel stuff for a number of years now, without problems. I've used on different combinations of Access and Windows, and have had great results with...
14
by: nospamhere | last post by:
Hello Stephen and all, This is such a cool group. I really need to spend more time here. A few months ago I noticed some brief discussion here about the fact that your excellent HTML Editor...
8
by: grant | last post by:
Hi I've copied Stephens code into my db, and can get it to work, but only on "plain Jane" reports with no images. Most of my reports has an unbound image obluect in them that I set to an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.