Vertical Scrollbar not appearing

Galaxiom

Super Moderator
Staff member
Local time
Today, 22:31
Joined
Jan 20, 2009
Messages
12,895
I have a subform which displays a number of records that exceeds the allocated space. However the vertical scrollbar does not appear until a record is selected beyond the edge of the subform. This can only be done by using the down arrow key or navigation buttons.

Without the scrollbar being immediately present a user could assume that all records are already being displayed.

Once the scrollbar appears it remains present and the full extent of the records can be viewed using the mouse scrollwheel but I would like this to work right from the start. My belief is that the scrollbar should appear automatically whenever the records overflow the subform area.

Scrollbar property of the subform is set to show both.

Access 2007 with all updates on XP.
 
Looks like posting a picture will take a while by the time I set up an album etc. Then I would have to remove the data for privacy.

Was my description that bad? It is simply a subform showing the results of a query in datasheet view. Seven records are displayed of the 37 total. A vertical scrollbar should be present but it isn't showing until I navigate to record number eight.

The data was originally not wide enough to require a horizontal scrollbar so just to see what happened I made the columns wider so that one was entirely outside the subform area. The horizontal scrollbar appears immediately on load as it should.

Can set up to post a picture sometime but haven't got time today.
 
Grasping a bit here as the quick sample I threw together could not duplicate your experience ...

- What is the base height to the sub-frm source object compared to the height of the sub-form control?

- What is the view mode of the subfrm source object (datasheet?) ... do you have all other view modes marked as "No" ..
 
I think I see what you are grasping at and it is something to consider.

The subform control on the main form is just under 7cm high
The subform object itself is 11cm high.

Subform source is in Datasheet mode but Form and Layout views are also enabled.

A variant from default is the row height of the displayed data. It is essentially two text rows high using Calibri 11 point. This equates to about one cm per row as seven records show in the subform.
 
I know it's an old thread but I am having the same problem as the OP and was wondering if a solution was ever found. I have a subform with more data than can be displayed in the available space, and the vertical scrollbar does not appear until I force scrolling to take place by pressing the down-arrow key a number of times to force the cursor past the last visible record.
 
Last edited:
After the form loads, try moving the recordset to the last record and back to the first.

If you're not having much joy, upload a stripped down version of your db and we'll have a look.
 
I finally got it working. The solution was to call the MoveLast/MoveFirst method of the subform Recordset from the Load event of the main form. And it had to be exactly that combination. It couldn't be the RecordsetClone object, it couldn't be in the Open event, and it couldn't be in the event procedure of the subform.
 
As mentioned above in my post perhaps :rolleyes:


Absolutely! Sorry if you didn't feel I was giving you the credit you deserved. I just wanted to provide the exact details for anyone else who might find this thread, since your instructions were more general in nature, and there are so many different combinations that one could try, with only one that works. :)
 
Absolutely! Sorry if you didn't feel I was giving you the credit you deserved. I just wanted to provide the exact details for anyone else who might find this thread, since your instructions were more general in nature, and there are so many different combinations that one could try, with only one that works. :)
I'm not after credit, but a reference to what was advised would be nice so that we don't feel ignored :)

I'm still curious why that isn't working as normal. Do you have over 2000 records in the subform?
 
The subform has only about 15 records, but in the on_current event of the subform my code does an aggregrate query on a table with about 7000 records. If I comment that out, it works fine.

I was just putting together a stripped down version when I found the solution. See attachment if you're interested.
 

Attachments

Sure it works, but you've significantly reduced functionality compared to my version! Where's the code in the On_Current event to update the status bar? I already knew that removing that code would fix the problem, but that code is important and needs to stay.
 
Last edited:
I didn't remove it on purpose. I've added it back and it still works. See attached.

What I'm trying to tell you is the problem is not your Current event, the form somehow got corrupt or something went wrong somewhere. All I did was recreate the subform control from scratch and base its Record Source on a query.
 

Attachments

The solution is to send DoVerb(this.min) or some value like DoVerb(0).

Best regards,
Rick C. Hodgin
 

Users who are viewing this thread

Back
Top Bottom