Hi Ron
Thanks for posting your version.
I've tried it with mixed results
a) 32-bit Access 365 - I get error 453 at startup
Debug highlights the line for the horizontal scrollbar position
When the form opens the textboxes are blank and the form is non-functional
b) 64-bit Access 365 - it worked perfectly! Well done
So I looked at the code and made 2 changes
In modSyncScrollbars I added conditional compilation using Win64 compiler (which normally I never use
Code:
#If Win64 Then
Declare PtrSafe Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" (ByVal hwnd As LongPtr, ByVal nIndex As Long) As LongPtr
#Else 'added by isladogs
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
#End If
Then a linked change in clsSyncScrollbars
Code:
' scrollbar found, get style and verify it's the one we want ' (horiz = 137573172, vert = 137573173)
#If Win64 Then
sbStyle = GetWindowLongPtr(hWndSB, GWL_STYLE)
#Else 'added by isladogs
sbStyle = GetWindowLong(hWndSB, GWL_STYLE)
#End If
It now works in 32-bit Access as well - see attached
I expect there is a better way of doing this than the above but I haven't time to look at it further at the moment