VBA to page down in a subform

K

KRR

Hi,

I have a tab control in a subform that is twice as long as the subform. When
I hit a certain field in the tab control I want the subform to automatically
page down so the user see's the entire botton half of the tab control
contents.

Is there a way to do this?

Right now when I navigate through the fields fields and get to the bottom
half of the tab control it only shows the field with the focus at the bottom
of the form and nothing below.

Thanks,
Ken
 
B

bhicks11 via AccessMonster.com

I think the easiest way to do this would be to set focus to a control at the
bottom of the form and then move focus back up to the control that you were
last in the top of the form on. This should leave with the form's bottom
half in view.

In the control On GotFocus event put:

Me.lastcontrol.setfocus
me.othercontrol.setfocus

Bonnie
http://www.dataplus-svc.com/database_programming.htm
 
A

AccessVandal via AccessMonster.com

You insert a pagebreak control after/before near the last control where you
want to break the page.

In the last control where you break the page, use the on lost focus event
like

Private Sub ControlName_LostFocus()
DoCmd.GoToPage 2 ' go to page 2
End Sub

ControlName is the last control/textbox at the bottom of the page.

If you have more than two page, insert another pagebreak control. Again Docmd.
GoToPage 3.
As you can guess, you can also go back to page 1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top