473,320 Members | 1,945 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,320 software developers and data experts.

Access 2003 Listbox scrollbar -- won't appear

Hello world:

I have a Parent form with a combobox, where the user selects a Contract or
Estimate number.
Then, on a subform, I have a listbox that gets filled with the details of
the selected Contract.
The subform listbox shows 21 rows.
That has been fine, but now we are starting to get some Contracts or
Estimates with more than 21 items.

When there are more than 21 items, no scrollbar shows up on the right side
of the listbox.
Users can't get to item 22 and up.
That's a problem.

I searched a bit, and found a Stephen LeBans suggestion from 1992/1993.
His suggestion is to force Access to recount the rows in the listbox.
In the Form_Load event of the form, he suggests putting:

Dim lngCount As Long
lngCount = Forms!frmParent!frmChild.Form.lstListBox.ListCount

Now, since the listbox is empty when the form opens, that is not what I did.
I put the code in the After_Update event of the listbox, figuring that
should work.
It doesn't work.
(I also tried putting it in the Form_Load, but no joy).

I added this message box:
MsgBox "RowCount is " & lngCount
which correctly shows "Row Count is 25".

No scrollbar ever appears.

What am I doing wrong?

Alan

Nov 13 '05 #1
3 5276
Alan Lane wrote:
Hello world:

I have a Parent form with a combobox, where the user selects a Contract or
Estimate number.
Then, on a subform, I have a listbox that gets filled with the details of
the selected Contract.
The subform listbox shows 21 rows.
That has been fine, but now we are starting to get some Contracts or
Estimates with more than 21 items.

When there are more than 21 items, no scrollbar shows up on the right side
of the listbox.
Users can't get to item 22 and up.
That's a problem.

I searched a bit, and found a Stephen LeBans suggestion from 1992/1993.
His suggestion is to force Access to recount the rows in the listbox.
In the Form_Load event of the form, he suggests putting:

Dim lngCount As Long
lngCount = Forms!frmParent!frmChild.Form.lstListBox.ListCount

Now, since the listbox is empty when the form opens, that is not what I did.
I put the code in the After_Update event of the listbox, figuring that
should work.
It doesn't work.
(I also tried putting it in the Form_Load, but no joy).

I added this message box:
MsgBox "RowCount is " & lngCount
which correctly shows "Row Count is 25".

No scrollbar ever appears.

What am I doing wrong?

Alan


In the GotFocus event for the listbox, enter something like
msgbox Me.YourListBoxControlName.ListCount

If there are 21 records, you'll see 21. If you have column headings,
you'll see 22. Now go to a record where you know there will be more
than 21 records

Check your query's SQL (View/SQL) and see if you use TOP, as in Select
Top 21...
Nov 13 '05 #2
I am as perplexed by your problem as you are. I use list boxes very
often but have not come across your problem.

I suggest that all of the counting of rows etc is a red herring. I
don't do any of that and my boxes show the scrollbar once the list
contains more than the default 8 values.

How about creating a new listbox on a copy of your form. Don't do any
of the row counting or other fancy stuff and see what happens.

Nov 13 '05 #3
Thanks to Salad and summerwind for their responses.

Things get wierder and wierder.

I accidently found out that, if I press either the <Ctrl>, <Shift> or <Alt>
keys while displaying my Parent/Child form with more data in the listbox
recordset than will show in the listbox, after having selected one of the
entries ... the listbox expands up to cover the whole subform!

I could not believe this was happening, so I phoned some of the users. It
works this way in both the Access XP mde and the Access 2003 mde. It seems
to me that the listbox should stay the size I set it, and not grow to take
up the entire subform. What is going on here? Is this a bug in Access? Do
I have a virus or something? Can anyone replicate this behavior?

Alan
"Alan Lane" <aw*****@yahoo.com> wrote in message
news:Ug****************@tornado.socal.rr.com...
Hello world:

I have a Parent form with a combobox, where the user selects a Contract or
Estimate number.
Then, on a subform, I have a listbox that gets filled with the details of
the selected Contract.
The subform listbox shows 21 rows.
That has been fine, but now we are starting to get some Contracts or
Estimates with more than 21 items.

When there are more than 21 items, no scrollbar shows up on the right side
of the listbox.
Users can't get to item 22 and up.
That's a problem.

I searched a bit, and found a Stephen LeBans suggestion from 1992/1993.
His suggestion is to force Access to recount the rows in the listbox.
In the Form_Load event of the form, he suggests putting:

Dim lngCount As Long
lngCount = Forms!frmParent!frmChild.Form.lstListBox.ListCount

Now, since the listbox is empty when the form opens, that is not what I
did.
I put the code in the After_Update event of the listbox, figuring that
should work.
It doesn't work.
(I also tried putting it in the Form_Load, but no joy).

I added this message box:
MsgBox "RowCount is " & lngCount
which correctly shows "Row Count is 25".

No scrollbar ever appears.

What am I doing wrong?

Alan

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: carmen | last post by:
I need to have in a form a listbox with a big scrollbar (I'm working for a touchscreen). As the scrollbar that the listbox has is small, I put a listbox withou scroll and a scrollbar independent....
2
by: Limin | last post by:
I add some picturebox in the listbox as controls like following. Dim myPic as PictureBox 'Init myPic from here '... '... for i=0 to 30 'New picturebox '... 'set mypic property '....
2
by: Daron | last post by:
I have a listbox that will only show the header row and the first record regardless of how many records are returned. I can find no code or settings that account for this. Details: - The list...
2
by: Paul_Madden via DotNetMonster.com | last post by:
I am handling the Listbox DrawItem event to enable the listbox strings to be displayed in different colours for easy reading. Have set ScrollAlwaysVisible and HorizontalScrollbar to true. I...
2
by: kurt sune | last post by:
How do I render the scrollbars by CSS in a listbox? I have understood that an asp listbox gets rendered as a select element. So I tried first by adding a style element: ..TA...
1
by: orofiamma | last post by:
It may appear odd, but I need to control the vertical scrollbar position of a listbox by buttons. So I'll have a "Scroll up" button and a "Scroll down" button. When I click "Scroll down", i.e.,...
0
by: Alex | last post by:
Any idea on how to manually activate the horizontal scrollbar on a listbox? I'm using ownerdrawfixed mode to color list items and it seems to work ok, but the scrollbar won't show at all.
0
by: LostInMd | last post by:
Hi All, I've got an owner drawn listBox where I draw and measure the items that I add to the listBox. For example, I have a listBox that can only display 10 characters on each horizontal line. ...
2
by: Appu2008 | last post by:
Hi, Iam using Python 2.5 and developing an application using Tkinter. I want a listbox with scrollbar. I tried to combine both but it gets filled in the entire screen. Here is the code.. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.