Change focus in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a button on my switchboard which opens a "tabbed" form. However, when
it opens up, the form opens to the middle of the page (the vertical scroll
bar on the right is not at the top). How do I force the tabbed form to open
so that the focus is automatically set to the top of the page?

Thank you,
KBV
 
Hi,
make sure that a control up top is first in the tab order of the form. If
that doesn't fix it then add a tiny command button to the top left corner of
the control. You can set its transparent property to yes. You can then
programmatically set focus to this control on the on open event of your form
e.g.:

Me.YourCommandButton.SetFocus

HTH
Good luck
 
Can you explain what you mean by, "make sure that a control up top is first
in the tab order of the form". How do I check that? I'm new to forms.

Regards,
KBV
 
Open the form in design view...go to view...tab order...the control at the
first position will receive focus first when the form openes. If this control
is down the form then it might force the scrolling.
HTH
Good luck
 
Back
Top