Page 4 of 4 FirstFirst 1234
Results 46 to 54 of 54
  1. #46
    Remster is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2010
    Posts
    307
    Actually, no need to wait until this evening. Try changing the adjustment of 4 twips to 6 twips (the image below explains why). It works for me.



    Click image for larger version. 

Name:	Capture.PNG 
Views:	22 
Size:	27.8 KB 
ID:	48303

  2. #47
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,457
    Using my example app on my desktop PC both values are 330.
    The code is stable whether I use 4, 6 or nothing

    On my tablet PC, the values are 336 and 340!
    Despite that, its also currently stable using 4, 6 or nothing.

    I assume the variation in those two values is related to resolution and/or screen size.
    Probably safest to do a check for those values on form load and allow for the actual difference in the code
    For example:

    Code:
    Option Compare Database
    Option Explicit
    
    Dim intCST As Integer, intSHH As Integer, intDiff As Integer
    
    Private Sub Detail_Paint()
    
    'modified to allow for twips difference in currentsectiontop compared to header height
       If Me.CurrentSectionTop > Me.Section(acHeader).Height + intDiff Then
            Me.TimerInterval = 0
            Me.Recordset.Bookmark = Me.Bookmark
            Me.Recordset.Move -Round((Me.CurrentSectionTop - Me.Section(acHeader).Height - intDiff) / Me.Section(acDetail).Height)
            Me.TimerInterval = 100
        End If
    
    End Sub
    
    Private Sub Form_Load()
    
        intCST = Me.CurrentSectionTop
        intSHH = Me.Section(acHeader).Height
    
        intDiff = intCST - intSHH
    End Sub
    
    
    Private Sub Form_Timer()
       
       Me.TimerInterval = 0
       Parent.fsubImageTooltip.Requery
      
    End Sub
    
    Private Sub Form_Open(Cancel As Integer)
        
        If Application.CurrentObjectName = Me.Name Then
           MsgBox "This form is designed to be used with other forms.   " & vbCrLf & vbCrLf & _
                "It cannot be opened directly from the navigation pane   ", vbExclamation, "Action not allowed!"
            Cancel = True
            Exit Sub
        End If
    
    End Sub
    @orange
    Does this now work for you?
    Attached Files Attached Files
    Colin, MVP 2022, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #48
    Remster is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2010
    Posts
    307
    Yes, that sounds good. It didn't occur to me that the current record would necessarily be the top one, because I was forgetting that the getting-out-of-sync behaviour I'd discovered occurred only in Form_Paint. What you've proposed is better than my other idea of allowing margins of 10 twips (say) either way.

  4. #49
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,324
    @Colin,

    RE, v1.62
    Yes it works now without the uncontrolled scrolling. I am able to use the vertical scroll and the down arrow at bottom of vertical scroll.

    Interesting, can not upload a gif. Gets converted to static jpg???

  5. #50
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,457
    Hi Jack
    Many thanks. Hopefully we now have code that will work on all workstations.

    If not, the next step might need to be to use the Wizhook.TwipsFromFont function to identify / use the exact heights in code as in my Web article Accurately Move Forms & Controls (isladogs.co.uk)

    Out of interest, what were the two values you got for currentsectiontop and section(acHeader).Height?


    FYI I had similar problems with uploading video GIFs a few days ago
    Colin, MVP 2022, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #51
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,324
    Colin:

    ?Me.CurrentSectionTop
    336

    ?Me.Section(acHeader).Height
    330

    Also, notified Admin re gifs.

  7. #52
    Remster is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2010
    Posts
    307
    Come to think of it, we've overcomplicated it slightly. This would do:

    Code:
       If Me.CurrentSectionTop > intCST Then
            Me.TimerInterval = 0
            Me.Recordset.Bookmark = Me.Bookmark
            Me.Recordset.Move -Round(Me.CurrentSectionTop - intCST) / Me.Section(acDetail).Height)
            Me.TimerInterval = 100
        End If

  8. #53
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,457
    Hi
    Yes you're right! Keep it simple!
    Colin, MVP 2022, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #54
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,457
    For info, I've just added an article based on this topic to my website: Continuous subform selection using the vertical scrollbar

    Thanks again to @Remster for coming up with the ideas developed in this thread.
    Last edited by isladogs; 07-16-2022 at 02:06 PM.
    Colin, MVP 2022, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Page 4 of 4 FirstFirst 1234
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 01-16-2018, 02:51 AM
  2. Vertical Scrollbar Appears At Random
    By lccrews in forum Access
    Replies: 3
    Last Post: 10-31-2017, 06:54 PM
  3. Missing Vertical Scrollbar
    By JeffChr in forum Forms
    Replies: 2
    Last Post: 11-21-2014, 07:54 AM
  4. Vertical scrollbar issues with a subform
    By vange2013 in forum Forms
    Replies: 1
    Last Post: 11-27-2013, 09:13 PM
  5. Vertical scrollbar in reports
    By Cedarguy in forum Reports
    Replies: 2
    Last Post: 11-07-2012, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums