473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Required: Simple Detect Vertical Scrollbar code

Hi all

Using MS Access 2000, Win XP

I require a quick and dirty (or all-singing and dancing) way of detecting whether a vertical scrollbar is visible on a sub-form.

apologies if posted in wrong forum - didn't see a VBA section

thanks
Jul 15 '06 #1
2 6617
comteck
179 100+
I'm not sure what you mean by "detecting" scroll bars. You can, however, turn the scroll bars on or off.

While in design view for the form, go into proerties, and you see a field called "scroll bars" with a pull down menu. Click on the arrow and make your selection.

Hope this helps.
comteck
Jul 15 '06 #2
zzqxxq
28
MS Knowledge Base Article KB207642 describes how you can control when the scrollbars display - the code below counts the number of rows that will be displayed before displaying the scrollbars.

Private Sub Form_Current()

' If the number of records in the subform
' is greater than 4, display the
' horizontal and vertical scrollbars.
If Me.RecordsetClone.RecordCount > 4 Then
Me.ScrollBars = 3
Else
Me.ScrollBars = 0
End If

End Sub

I know this is sort of the reverse of what you actually want but, it might help you if what you are actually trying to do is control when scroll bars display. Of course the IF statement can return a number of lines that will display, therefore if you know how many rows can display without the scroll bars in your current subform window, you can test it against that number as follows:

Assume that the number of rows that can display without a vertical scroll bar is 6 then just use that if statement to control whatever it is that you are trying to do:

Private Sub Form_Current()

If Me.RecordsetClone.RecordCount > 6 Then
(do whatever you are trying to do here)
End If

End Sub

Hope that helps
Best Regards,
Jul 15 '06 #3

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

Similar topics

2
by: Don Schneider | last post by:
I tried to setup a frameset which consists of 4 different subframes. Each of these subframes should fetch a different web page from the internet and display it completely (!). BUT: the vertical...
3
by: andrew.neale | last post by:
Hello, I have a div that has an overflow set to auto. I would like to know if the scrollbars are visible in javascript. Any help is appreciated. Thanks
3
by: buht | last post by:
Hello Everyone, Fairly new to c# here and have a question regarding scrollbars, particularly a vertical scrollbar. It looks like my options are restricted for the textbox scrollbars being...
0
by: Gene Hubert | last post by:
I've got two treeviews side by side on a panel on a form. They each have about 20 nodes in them. The treeview on the right has a vertical scrollbar. The treeview on the left needs a vertical...
1
by: deBassMan | last post by:
Hi all Using MS Access 2000, Win XP I require a quick and dirty (or all-singing and dancing) way of detecting whether a vertical scrollbar is visible on a sub-form. apologies if posted in...
4
by: ShaneO | last post by:
In a Windows Form I have a RichTextBox with Multiline = True and ScrollBars = Vertical. As expected, when Text is loaded into the RTB the Vertical ScrollBar will appear if needed. Does anyone...
1
by: platoon1sc | last post by:
Hi guys.I have a problem with Internet Explorer in my web-application. I have a vertical scrollbar into my jsps but firefox show the vertical srollbar, but IE doesn't. IE show a blank space where...
1
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, Is there a way to detect whenever scrollbars (the vertical) are shown on a treeview I need to know. 1) If scrollbars are visible after a rezise 2) If scrollbars are visible after change...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...

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.