473,569 Members | 2,762 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 4710
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
12705
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
4893
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 outside the visible area 3. A navigation button should appear if any contained control is outside the visible area
5
3938
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 characters. I would love to just show 2 inches, and have a scroll bar for viewing the rest of the info. I have my form property set to Default View:...
1
7895
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 bars to draw up but for some reason it is not appearing. I have set Autoscroll = true and even the margin values for scroll but the
0
3823
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 vertical scroll bar control looks brown. please guide -- sachin
1
6265
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 want to create scrollbars but they don't appear - I set autoscroll to true and autoscrollmargin to (5,5). If I add a button or other controls the...
1
2860
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
2214
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. Is this normal? If so it's very annoying and confusing. If not then how do I get it so my form design window doesn't have scroll bars. --...
5
3258
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 when the text size gets too big I truncate the string and re-set the TextBox.Text property. This solution is very crappy as it creates a flickering...
0
1363
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 the page. This table also has additional right aligned cells on the same row for such things as logging out. When the child menu items are...
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7666
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.