473,503 Members | 3,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looking for way to control scroll bars with VBA

27 New Member
I have a main form that has a tab control about 5 tabs with subforms.
When the main form comes up the scroll bar automatically goes down a little so the tabs dont show up they are scrolled up to far. Its annoying, I would like to find some vba possibly on the open form event to lock the vertical scroll bar at the top.

thanks
Feb 7 '10 #1
2 4697
missinglinq
3,532 Recognized Expert Specialist
The problem is being caused by the Tab Order on your main form. Apparently the first control to get focus when the form opens is way down the form.

Place a textbox on your form in the top, left most corner
Goto Properties - Other and rename it DummyTextBox
Now resize it down to just a pinpoint (it won't be visible on the screen)
Now use this code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  DummyTextBox.SetFocus
  3. End Sub
If you want to ensure that it does this when moving from record to record, place the code in the Form_Current event instead of the Form_Load event.

Welcome to Bytes!

Linq ;0>
Feb 7 '10 #2
simulationguy
27 New Member
Exactly what I was looking for and it worked perfectly.
Feb 10 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
12700
by: Arlie Rahn | last post by:
I would like to ad a custom scroll bar control to my app that has a customizable and "flat" look to it (not the normal VB look). Does anyone have any ideas on where to find a good one?
3
4883
by: Tony | last post by:
So, here is the (back of a cigarette packet) spec for a new UserControl I am trying to develop - 1. It needs to be a control container 2. Scroll bars should appear if any contained control is...
5
3923
by: sara | last post by:
I haven't been able to find this answer in previous posts; I have a form, with a subform that is displayed in datasheet view, and one field "Item Description" could be from very few to many...
1
7884
by: Anand Ganesh | last post by:
Hi All, I am trying to draw a picture in a panel control. It is drawing up correctly. When the picture size is greater than the panel control, I am expecting horizontal and vertical scroll...
0
3821
by: Sachin | last post by:
How to match the look and feel of vertical scroll bar with the inbuilt vertical scroll bars of some controls like PrintPreviewControl, Rich Text box , etc. Their scroll bars look blue where the...
1
6253
by: edi sol | last post by:
Hi, I am writing a hex edit control from a UserControl. I use drawtext method of the graphics object in the OnPaint. When the text which I draw go out of the visible rectangle of the control I...
1
2851
by: UJ | last post by:
How can I get rid of the scroll bars when I use a WebBrowser control? If the page/object I'm trying to display is to big - tough! I don't want the scroll bars. Thanks. Jeff.
2
2201
by: usenet | last post by:
When I open a form design window in Access 2003 it *always* has scroll bars, this is even when the form itself is tiny. It's as if the 'page' on which the form is being designed is very large. ...
5
3254
by: Dinsdale | last post by:
I have an application that recieves text data via external input (i.e. serial) and displays it on the screen (we use carraige return as a delimiter). At this point I use a regular old text box and...
0
1357
by: jojobar | last post by:
We are using the ASP:Menu control (horizontal) for site navigation. The menu is contained by a table with css styles that allows us to give the illusion of a menu bar that runs the entire width of...
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7258
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.