MS Access Version 2412 Build - VBA to override default form record scrolling behavior no longer works

Anonymous
2025-01-13T22:49:52+00:00

I have several continuous and single forms and use the following code to override the default record scrolling behavior. With the January 7 MS Office update, nad update to Access Version 2412, the following mouse wheel event code no longer works.

What changed in Version 2412?

I've also tried changing it to DoCmd.GoToRecord , , acPrevious etc. but the default record scrolling behavior in forms is what persists.

On Error GoTo Err_Handler

    'Purpose:   Make the MouseWheel scroll in Form View in Access 2007 and later.

    '           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)

'        If lngCount < 0& Then

'            DoCmd.GoToRecord , , acPrevious

'        Else

'            DoCmd.GoToRecord , , acNext

'        End If

    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
Microsoft 365 and Office | Access | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2025-01-15T01:44:59+00:00

    The Access team have been able to replicate the Count bug with the repro database I sent them and have confirmed that it will be fixed.

    Although not mentioned in this thread, I cannot see how the Page argument would ever be true.

    3 people found this answer helpful.
    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2025-01-22T23:49:31+00:00

    News from the Access team

    The mouse wheel issue will be fixed in version 2501, which will be available next week (W/C 27 Jan)

    My related article on the Access Forever blog site will be updated again when the release date and build number are known

    The Beta Channel should be fixed at around the same time

    1 person found this answer helpful.
    0 comments No comments

11 additional answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Anonymous
    2025-01-14T22:00:20+00:00

    I was able to fix this by reverting back to a previous version of office using the answers in this article: This article ("How to revert to an earlier version of Office") - Microsoft Community using the build # after the 16.0. that I needed to revert to. In my case it was build # 18227.20162. I then used the code in this article Can't scroll records with mouse wheel - Microsoft 365 Apps | Microsoft Learn exactly as written as the VBA code for the Mouse Wheel property in the form.

    0 comments No comments
  3. Anonymous
    2025-01-28T14:22:04+00:00

    Thank you, ColinRiddington

    I see that I have been updated to:

    Microsoft® Access® for Microsoft 365 MSO (Version 2501 Build 16.0.18429.20044) 64-bit

    But it is still not working. Any thoughts?

    0 comments No comments