automatically size subform height

tfullerton

New Member
Joined
Jun 8, 2004
Messages
16
Does anyone know how to dynamically set the subform height based on the number of rows returned? The default view for my subform is datasheet and I want to see all rows returned by my subform without scrolling. :eek:
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
What happens if 100 records are returned? You'll struggle to fit this on screen and keep it legible.

While you can change the subform's height and you can count the number of records returned you are stuck with two problems:

1. How do you know what height to set a subform based on the height afforded to a record in Datasheet View and what happens to the parent form if you start messing about with the subform object's Height and Top properties?

2. Different users make use of differing screen resolutions - do you know how this will affect any code you write?
 
Upvote 0
Actually, I don't mind if I have to scroll around the main form to see all the results of the subform, I just don't want to have to scroll inside of the subform itself. Max record count returned by the subform is expected to be less than 30 but can be as few as 5. I'm hoping to only mess with the subform's Height property, not its Top but I don't know much about it.
 
Upvote 0

Forum statistics

Threads
1,221,707
Messages
6,161,416
Members
451,705
Latest member
Priti_190

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top