Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing the top section of a subfrom

Status
Not open for further replies.

oggsta

Technical User
Jun 22, 2002
41
0
0
GB
I have a simple problem.

I have a main form, and within that i have a sub form.

When i open the main form, the subform is centred and I cannot see the top of the subform, which has all the relevant tabs.

There is a horizontal scroll bar which will allow me to scroll to the top and view the top of the sub form.

However there must be a property to ensure that every time the subfrom is opened within the main form that scroll bar automatically goes up to the top and I am able to see the tab headers. I

I am concerned that users may be a little confused if they cannot see the tab bars.

Any help appreciated?
 
You can SetFocus to the tab control to make the subform scroll it into the visible area. You can then do another SetFocus to put the cursor where you really want it.

However, it's more convenient for the user if you either make the subform control large enough to display the subform, or make the subform small enough to fit in the control.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
I see you what you mean but I am not entirly sure how to implemnt what you have said.

I have opend the tab control but i am not sure which control or event to modify and if it as simple as changing a proprety; Or does it involve a little VB script; and if so using which event.

Thanks
 
1. Look up SetFocus in the help file. Look at the examples.
2. In the form's Open event, do a SetFocus to move the focus to your tab control, and then immediately do a SetFocus to move the focus to the control that should be entered first. It really doesn't matter whether you do the SetFocus in a macro or in an event procedure.

Or, as I said above, you can simply make your subform control the same size as the form it displays. Just resize it in the design window and save it.

BTW, I assume this is an actual form, not a data access page, but your question about VB script leaves me unsure. VBScript can be used on data access pages. Forms use VBA code. They're somewhat different things.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top