Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / February 2007

Tip: Looking for answers? Try searching our database.

Advance to next record with mouse wheel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gerry Flinn - 27 Feb 2007 20:23 GMT
In Access 2003 I could qickly scroll through form records with the mouse
wheel.  In Access 2007 the only way to advance seems to be Page Up or Down.  
The mouse wheel does not move to the next or previous records.  I can not
find a way to change setting to all this navigation method.  Any ideas?

Gerry Flinn
Allen Browne - 27 Feb 2007 23:44 GMT
Use the MouseWheel event of the form:

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
On Error GoTo Err_Handler
   'Purpose:   In Access 2007, make the MouseWheel scroll in Form View.
   '           Many people found this behavior annoying, so MS removed it.
   '           This code lets Access 2007 behave like older versions.

   'Run this only in Access 2007 and later, and only in Form view.
   If (Val(SysCmd(acSysCmdAccessVer)) >= 12) And (Me.CurrentView = 1) Then
       'Save any edits before moving record.
       RunCommand acCmdSaveRecord
       'Move back a record if Count is negative, otherwise forward.
       RunCommand IIf(Count < 0&, acCmdRecordsGoToPrevious,
acCmdRecordsGoToNext)
   End If

Exit_Handler:
   Exit Sub

Err_Handler:
   If Err.Number <> 2046& Then     'Can't move to that record
       MsgBox "Error " & Err.Number & ": " & Err.Description
   End If
   Resume Exit_Handler
End Sub

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> In Access 2003 I could qickly scroll through form records with the mouse
> wheel.  In Access 2007 the only way to advance seems to be Page Up or
[quoted text clipped - 3 lines]
>
> Gerry Flinn
Gerry Flinn - 28 Feb 2007 00:46 GMT
Allen,

I am not experienced in using Visual Basic, but I did paste your code into
the event builder, but I kept getting syntex errors.  Do I post the entire
text you wrote or only part of it?  Also one of your commands says "IIF".  Is
this a typo.

Thanks for the help.

Gerry Flinn

> Use the MouseWheel event of the form:
>
[quoted text clipped - 30 lines]
> >
> > Gerry Flinn
Allen Browne - 28 Feb 2007 06:33 GMT
1. Open the form in design view.

2. Open the Properties box (View menu.

3. On the Events tab, set the Mouse Wheel property to:
       [Event Procedure]

4. Click the Build button (...) beside the property.
Access opens the code window.
Set up the code there as shown.

If you don't see the property, you are looking at the properties of a text
box where you need to be looking at the properties of the form.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Allen,
>
[quoted text clipped - 44 lines]
>> > not
>> > find a way to change setting to all this navigation method.  Any ideas?
Gerry Flinn - 28 Feb 2007 14:38 GMT
Allen,

I got it to work.  The problem with the first paste was an extra line break,
that once removed solved the problem.  I never would have figured this out on
my own.

Thanks for your help.

Gerry Flinn

> 1. Open the form in design view.
>
[quoted text clipped - 58 lines]
> >> > not
> >> > find a way to change setting to all this navigation method.  Any ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.