Tab Order question

G

Guest

Hello,

I have a form with several tabs on it, and on one of the pages, there's some
text, and only then comes a subform. When I go to that tab, the page always
scrolls down to the first subform, hiding what's above it.

How can I get rid of this?
I thought maybe adding an invisible text box at the top of the page will
grab the focus, but it would appear that invisible text boxes don't get
focus.
Can somebody recommend another way to prevent the form from scrolling down
to its first subform?

Thank you.
 
G

Guest

Hi Niniel

You can't et the focus to a field with it's visible status set to No.

There are, however, other ways of hiding a text box that will still allow
the field to get the focus.

Create a text box and set it's baground to the same color as the form (don't
use transparent or it will change color when got focus)

Set the text box border to transparent.

Insert this into the OnLoad event of the form

Private Sub Form_Load()
Me.TextBox.SetFocus
End Sub

Hope this helps
 
G

Guest

Thank you, Wayne, that was helpful.
I started out doing something slightly different though - I made the text
box so small that it's only a small dot/depression on the screen, and then I
rearranged the tab order of the page so that the text box comes first. It
worked, save for the imperfection of that small dot.
But then I did as you suggested and made the borders transparent, and the
background as well [even though you advised against it], and voila, the
dot/depression is gone. You don't see anything when you switch to the page. :)
 
G

Guest

Well done Niniel

Access like most things needs a little time get the basics and after this
you can try and come up with your own ideas about how to solve problem. This
is just what you have done in this case. Well done again

--
Wayne
Manchester, England.
Enjoy whatever it is you do


Niniel said:
Thank you, Wayne, that was helpful.
I started out doing something slightly different though - I made the text
box so small that it's only a small dot/depression on the screen, and then I
rearranged the tab order of the page so that the text box comes first. It
worked, save for the imperfection of that small dot.
But then I did as you suggested and made the borders transparent, and the
background as well [even though you advised against it], and voila, the
dot/depression is gone. You don't see anything when you switch to the page. :)


Wayne-I-M said:
Hi Niniel

You can't et the focus to a field with it's visible status set to No.

There are, however, other ways of hiding a text box that will still allow
the field to get the focus.

Create a text box and set it's baground to the same color as the form (don't
use transparent or it will change color when got focus)

Set the text box border to transparent.

Insert this into the OnLoad event of the form

Private Sub Form_Load()
Me.TextBox.SetFocus
End Sub

Hope this helps
 

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