Scrolling on a form

  • Thread starter John S. Ford, MD
  • Start date
J

John S. Ford, MD

I'm working in MSAccess 2000. I have a dialogue box form with many controls
that the user has to scroll down to access all the controls. It scrolls
automatically if the user enters data and hits <return> or <tab> to get to
the next control in the tab order. The "cycle" property of the form is set
to "Current Record".

What I want is for the form to scroll ALL the way to the top after the user
accesses the bottom control (a textbox) and hits <return> or <tab> with the
focus ending on the top control of the same record.

The problem is that although the focus does go to the top control, the form
doesn't scroll completely to the top. This is visually confusing because
there is some text on the form that is cut off at the top of the form.

I've attempted to solve this by creating a "dummy" cmdbutton at the top-left
of the form, setting it's "transparent" property to yes, and making the
"setfocus" event send the focus to the first "real" control of the form like
I want. Unfortunately, this doesn't seem to work as the form is still not
scrolled completely to the top.

As an aside, if I set the "cycle" property to "All Records", my solution
works perfectly but of course, my intent is to stay only on the same record.

Any ideas on how to fix this?

John
 
J

John S. Ford, MD

The problem isn't with the tab order or the cycling property. It's that
although the dummy control (which is first in the tab order) gets the focus
after hitting <return> or <tab> on the last control but the form doesn't
scroll to the absolute top. I have the following routine attached to the
"GotFocus" event:

Private Sub cmdDummyTopLeft_GotFocus()
txtPatientMRNumber.SetFocus
End Sub

John
 

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