Saved by the Mouse

  • Thread starter prosfora via AccessMonster.com
  • Start date
P

prosfora via AccessMonster.com

Sorry to beat a dead mouse, but I installed Stephen Lebans' MWHook
application, and although it works great to prevent the page from scrolling,
my form can still scroll through records which causes a premature save if the
wheel accidently turns a notch.

I only imported the one module, modMouseHook, and placed the OFF code into
the Load event of the opening form.

Is there more I need to do to disable navigation as well? I've read many
other postings that recommend this as a cure, but unfortunately I'm still
plagued by the mouse. Please help!
 
T

TC

I'm sure that Stephen will reply to your question in due course.

However, in the mean time: what exactly do you mean? You say that it
"works great to prevent the page from scrollng", but then you say that
the form "can still scroll through records ... if the wheel turns ...".

So personally, I'm not sure what you actually mean. Does his code stop
the wheel working, or not stop it working?

TC (MVP Access)
http://tc2.atspace.com
 
P

prosfora via AccessMonster.com

TC,

I can spin the wheel and it will not scroll my form up or down (I'm still
able to do that with the bar which is fine), however all my fields still
scroll through the records, and this of course triggers a save which I don't
want (I've got a separate button for saving).

See either of the two following posts - one says it works, the other still
has same navigation problem---

"Mouse Wheel Causes Form to Save?"
S. D. - 07-28-2003 11:17

"I've gone to Lebans and read through the posts on the mouse wheel."
NotIT - 05-11-2005 09:48
 
T

TC

prosfora via AccessMonster.com wrote:

I can spin the wheel and it will not scroll my form up or down

Ok, I understand that.

(I'm still able to do that with the bar which is fine),

Ok, I understand that, assuming that "the bar" means, the vertical
scrollbar on the right hand side of the form.

however all my fields still scroll through the records, and this of course triggers a save which I don't want (I've got a separate button for saving).

"All my fields still scroll through the records"? Sorry, I'm not sure
that I understand that. Do you mean, that if you press Tab or Return
from the last field in the current record, it tries to go to the next
record, and therefore, tries to save any unsaved changes to the current
record? If so:

(1) You can stop that by setting the form's Cycle property to "Current
Record", and

(2) If you need to make some checks, about he data in the current
record, before the user saves the record, you *should not* put those
checks in any button code. You should put them in the BeforeUpdate
event of the form. That evetnt will fire regardless of /how/ the user
tries to save the current record: by pressing your button, or moving on
to the next record, or by any other means.

See either of the two following posts

Sorry, no-one has time to search through previous posts. Each post must
be self-contained. That's the way to get the most answers.

Cheers,
TC (MVP Access)
http://tc2.atspace.com
 
P

prosfora via AccessMonster.com

TC,

"All my fields still scroll through the records" means as you turn the
mousewheel, you scroll through the records. Each click of the wheel changes
the fields to the next or previous record, depending which direction you turn
it-------
 
S

Stephen Lebans

Did you follow the instructions and copy the MouseWheelHook.DLL into the
proper folder?

Post the code you have in your form's Load event.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
P

prosfora via AccessMonster.com

Stephen,

Here's the code that I placed into the Load event:

Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
End Sub

I created a separate folder for this test on my desktop, wherein I placed
copies of both my mdb and the DLL.




Stephen said:
Did you follow the instructions and copy the MouseWheelHook.DLL into the
proper folder?

Post the code you have in your form's Load event.
[quoted text clipped - 42 lines]
 
S

Stephen Lebans

Place a breakpoint on the End Sub line. Verify that blRet = TRUE. Let me
know.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


prosfora via AccessMonster.com said:
Stephen,

Here's the code that I placed into the Load event:

Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
End Sub

I created a separate folder for this test on my desktop, wherein I placed
copies of both my mdb and the DLL.




Stephen said:
Did you follow the instructions and copy the MouseWheelHook.DLL into the
proper folder?

Post the code you have in your form's Load event.
[quoted text clipped - 42 lines]
 
P

prosfora via AccessMonster.com

Is this what you mean Stephen? If so, it still doesn't prevent scrolling
through the records---

Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
blRet = True
End Sub

I also tried:

Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF(True)
End Sub

....and got Compile error message that sub or function is not defined

Stephen said:
Place a breakpoint on the End Sub line. Verify that blRet = TRUE. Let me
know.
[quoted text clipped - 19 lines]
 
T

TC

prosfora said:
Is this what you mean Stephen?
Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
blRet = True
End Sub


No. He means this:

Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
MSGBOX BLRET
End Sub

Tell him whether the MSGBOX statement displays the word "True", or the
word "False", when you open the form.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
P

prosfora via AccessMonster.com

TC,

It returns the word 'False'. Still doesn't stop the record-scrolling.
Is this what you mean Stephen?
Private Sub Form_Load()
[quoted text clipped - 3 lines]
blRet = True
End Sub

No. He means this:

Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
MSGBOX BLRET
End Sub

Tell him whether the MSGBOX statement displays the word "True", or the
word "False", when you open the form.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
T

TC

"False" shows that the MouseWheelOFF statement is not working
correctly. So we're getting there, slowly!

Hopefully Stephen will post back with some further suggestions.

In the mean time, you should re-read all the instructions or notes that
came with his software, and double-check that you have followed them
all - to the letter.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
S

Stephen Lebans

Can you step through the code and see where it is failing? Generally, I see
this when the MouseWheelHook DLL is not in the same folder as the front end
MDB.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


prosfora via AccessMonster.com said:
TC,

It returns the word 'False'. Still doesn't stop the record-scrolling.
Is this what you mean Stephen?
Private Sub Form_Load()
[quoted text clipped - 3 lines]
blRet = True
End Sub

No. He means this:

Private Sub Form_Load()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
MSGBOX BLRET
End Sub

Tell him whether the MSGBOX statement displays the word "True", or the
word "False", when you open the form.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
P

prosfora via AccessMonster.com

Am not exactly sure what to look for in the code Stephen. I created a
separate folder that I dragged and dropped your Access file and DLL file from
the dowloaded Zipped folder, along with a copy of my MDB; and then pasted
your recommended code in the Load event of the opening switchboard.

Is there anything in particular I should be looking for?

Stephen said:
Can you step through the code and see where it is failing? Generally, I see
this when the MouseWheelHook DLL is not in the same folder as the front end
MDB.
[quoted text clipped - 21 lines]
 
S

Stephen Lebans

Can you EMail me your MDB and I can have a look at it?

(e-mail address removed)


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


prosfora via AccessMonster.com said:
Am not exactly sure what to look for in the code Stephen. I created a
separate folder that I dragged and dropped your Access file and DLL file
from
the dowloaded Zipped folder, along with a copy of my MDB; and then pasted
your recommended code in the Load event of the opening switchboard.

Is there anything in particular I should be looking for?

Stephen said:
Can you step through the code and see where it is failing? Generally, I
see
this when the MouseWheelHook DLL is not in the same folder as the front
end
MDB.
[quoted text clipped - 21 lines]
 
P

prosfora via AccessMonster.com

Database forwarded to you---

Stephen said:
Can you EMail me your MDB and I can have a look at it?

(e-mail address removed)
Am not exactly sure what to look for in the code Stephen. I created a
separate folder that I dragged and dropped your Access file and DLL file
[quoted text clipped - 15 lines]
 
S

Stephen Lebans

You have to import the standard Code module named "modMouseHook" from the
sample MDB into your own MDB.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


prosfora via AccessMonster.com said:
Database forwarded to you---

Stephen said:
Can you EMail me your MDB and I can have a look at it?

(e-mail address removed)
Am not exactly sure what to look for in the code Stephen. I created a
separate folder that I dragged and dropped your Access file and DLL file
[quoted text clipped - 15 lines]
 
S

Stephen Lebans

I would imagine because the OP did not compile.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top