How to "page up" in a form using vba

radek225

Registered User.
Local time
Today, 12:31
Joined
Apr 4, 2013
Messages
307
My form opening with page down screen, how could I open it with page up screen?
 
Please see my attachment. Look at the position of vertical scroll bar. When I open my form the scroll bar should be on top.
 

Attachments

  • 1.png
    1.png
    54.4 KB · Views: 294
I have one long form with a couple of subform controls on it that sometimes does this nonsense. In my case, if top fields are blank and only fields lower down the form have values, then Access jumps the UI to be focused on fields which actually had data populated to them. It is a bit annoying, and I have filed that behavior into the "Access being Access" category... never found a resolution / work-around to the behavior.
 
it looks like you have a main form with a subform at the bottom. In you main form, I would set scrollbars to neither. In your subform, I would set the scroll bars to both
 
Perhaps the subform is taking the focus when the form opens? You could try to set the focus to the first control on the form on the On Open event:

Private Sub Form_Open(Cancel As Integer)
Me.YourControl.SetFocus
End Sub
 
it looks like you have a main form with a subform at the bottom.
yes
In you main form, I would set scrollbars to neither. In your subform, I would set the scroll bars to both
Doesn't work
kennejd If I set focus to the control which is on top, then scroll bar will be almost on top (labels will be invisible).

Is there any possibilities to push "pg up" button using vba? I think it is solution.
 
Is there any possibilities to push "pg up" button using vba? I think it is solution.

You would need to insure that the proper form / subform has focus. See...

How to SetFocus to a specific control on a Subform of a Form
http://www.access-programmers.co.uk/forums/showthread.php?t=221705#post1132324

Then use the SendKeys capability:

Minimize Ribbon
http://www.access-programmers.co.uk/forums/showthread.php?t=231335

SendKeys Statement
http://msdn.microsoft.com/en-us/library/office/gg278655.aspx
 

Users who are viewing this thread

Back
Top Bottom