abjMouseWheel

D

David

Some time back, I got the referenced module from one of these groups. The
purpose of the module is to control how the wheel on the mouse is used by a
form in A2007. It in effect changes pages when the wheel is moved.
The problem I have is that when I got a new computer and reinstalled A2007,
the module was not longer functioning.
Can anyone give me instructions as to how to "install" this module?
 
D

David

Here is what I have that used to work on an older machine that was also
running A2007.

Public Function DoMouseWheel(frm As Form, lngCount As Long) As Integer
On Error GoTo Err_Handler
'Purpose: Make the MouseWheel scroll in Form View in Access 2007.
' This code lets Access 2007 behave like older versions.
'Return: 1 if moved forward a record, -1 if moved back a record, 0 if
not moved.
'Author: Allen Browne, February 2007.
'Usage: In the MouseWheel event procedure of the form:
' Call DoMouseWheel(Me, Count)
Dim strMsg As String
'Run this only in Access 2007 and later, and only in Form view.
If (Val(SysCmd(acSysCmdAccessVer)) >= 12#) And (frm.CurrentView = 1) And
(lngCount <> 0&) Then
'Save any edits before moving record.
RunCommand acCmdSaveRecord
'Move back a record if Count is negative, otherwise forward.
RunCommand IIf(lngCount < 0&, acCmdRecordsGoToPrevious,
acCmdRecordsGoToNext)
DoMouseWheel = Sgn(lngCount)
End If

Exit_Handler:
Exit Function

Err_Handler:
Select Case Err.Number
Case 2046& 'Can't move before first, after last, etc.
Beep
Case 3314&, 2101&, 2115& 'Can't save the current record.
strMsg = "Cannot scroll to another record, as this one can't be
saved."
MsgBox strMsg, vbInformation, "Cannot scroll"
Case Else
strMsg = "Error " & Err.Number & ": " & Err.Description
MsgBox strMsg, vbInformation, "Cannot scroll"
End Select
Resume Exit_Handler
End Function
 
D

David

This used to work. By that I mean, when in a form, I could move the wheel
forward or back and the form would page up or down. It worked fine before.
But after I installed A2007 in new computer (same Win Ver. as well as
A2007), the wheel no longer functioned at all (but this only occurs in my
Form). All other aspects within A2007, the Mouse wheel is functioning, just
not in my Form as it used to.
 
G

Gina Whipp

David,

Have you checked References to make sure none are marked 'MISSING', though
it shouldn't just be impacting only one module it's worth the look. I would
also check that Name AutoCorrect is unchecked.

Also, when you say it only occurs '...in my form...', does that mean their
are other people using the using the datbase and they are not having the
same problem? I would also check to make sure all updates have been
installed.

Also, what version of Windows?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

David

Gina,
I am also have the same problem with another module for the same form. This
module converts an integer to have a decimal point installed automatcally
(by dividing it by 100) without having to enter a decimal and simply hitting
Enter. I also do not know how to "install" this module.
I do appreciate your help on this.
 
G

Gina Whipp

David,

Check your References, while the modules do not have any files associated to
them, 'MISSING' References can cause problems like this. So let's eliminate
that as the culprit. Also, and yes I know this asking a wee bit BUT can you
please type the References you do have set and the order in which they are
set. (Recently came across and issue where too many and the incorrect
References were checked causing the database to behave strangely.)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

David

I checked References and none are marked 'MISSING'. I unchecked Name
AutoCorrect in Access Options.
No, I am the only person using this DB. I have installed all updates for
A2007. I am using Vista x64 and have updated it to current. This is the
same version as in the old computer. No difference there.
Can you tell me where these modules are embedded? Although, I see
abjMouseWheel under "Unassigned Objects", I seem to recall having to
reference this somewhere in the form design somewhere. I am not able to
establish the location.
Where I go to design view for my form, I then go to Design, View Code. Now
on the bottom left, I see Properties for my Form. There is a line there for
"MouseWheel". When I add "abjMouseWheel" to the space to the right of
"MouseWheel" (=function(abjMouseWheel)), I then save it. Then when I attempt
to move my Wheel over the Form, I get the following error

This error occurs when an event has failed to run because Microsoft Office
Access cannot evaluate the location of the logic for the event. For example,
if the OnOpen property of a form is set to =[Field], this error occurs
because Access expects a macro or event name to run when the event is fired.

What do you think?
 
D

David

Here are the references in their respective order:

Visual Basic for Applications
Microsoft Access 12.0 Object Library
OLE Automation
Microsoft Active X Data Objects 2.5 Library
Microsoft Visual Basic for Applications Extensibility 5.3

That's it. Nothing else is checked and nothing is shown "MISSING"!
 
G

Gina Whipp

Perhaps you should reread these directions....

http://allenbrowne.com/ser-70.html

Sounds like you don't have the Module in the correct place.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

David said:
I checked References and none are marked 'MISSING'. I unchecked Name
AutoCorrect in Access Options.
No, I am the only person using this DB. I have installed all updates for
A2007. I am using Vista x64 and have updated it to current. This is the
same version as in the old computer. No difference there.
Can you tell me where these modules are embedded? Although, I see
abjMouseWheel under "Unassigned Objects", I seem to recall having to
reference this somewhere in the form design somewhere. I am not able to
establish the location.
Where I go to design view for my form, I then go to Design, View Code.
Now on the bottom left, I see Properties for my Form. There is a line
there for "MouseWheel". When I add "abjMouseWheel" to the space to the
right of "MouseWheel" (=function(abjMouseWheel)), I then save it. Then
when I attempt to move my Wheel over the Form, I get the following error

This error occurs when an event has failed to run because Microsoft Office
Access cannot evaluate the location of the logic for the event. For
example, if the OnOpen property of a form is set to =[Field], this error
occurs because Access expects a macro or event name to run when the event
is fired.

What do you think?

Gina Whipp said:
David,

Have you checked References to make sure none are marked 'MISSING',
though it shouldn't just be impacting only one module it's worth the
look. I would also check that Name AutoCorrect is unchecked.

Also, when you say it only occurs '...in my form...', does that mean
their are other people using the using the datbase and they are not
having the same problem? I would also check to make sure all updates
have been installed.

Also, what version of Windows?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm
 
G

Gina Whipp

Uncheck... ' Microsoft Visual Basic for Applications Extensibility 5.3'

This appears to only be needed back in Access 97 and it is the exact
Reference that was causing the problem in the other similar issue I refered
to. (Not really sure you need 'Microsoft Active X Data Objects 2.5 Library'
but without close examination I hesitate to remove the check mark.


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
J

Jack Leach

VBA App Extensibility 5.3 give access to the VBA IDE... modify text in the
code window with it, etc. I highly doubt the average developer have need of
this, but it does have its uses (I'm not sure what else it does, nor do I
have a lot of experience utilizing it).

ref: http://www.cpearson.com/excel/vbe.aspx


Personally I avoid the activeX and OLE refs as well if I don't have specific
need of them.


Just out of curiousity David, have you tried importing everything into a new
db? Make sure you turn Autocorrect off and select your references
accordingly in the new db before importing if you try it. By the sounds it's
only one or two forms, not all of them that are having this problem? If it
doesn't work on any of the forms there's a possibility you may have struck
some difference between the Access 12.0 Obj Lib and the previous version you
were using.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 

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