changing height of listbox based upon number of records

message from Hcoms on 18 May 2004
Hello ,

How can you change the height of a listbox based upon the number of records
that are in the listbox? This is to try and avoid the scroll bars.

Any help would be greatly appreciated!
 
Alex Dybenko replied to Hcoms on 18 May 2004
1. calcualte how much one row in pixels
in form load:
2. run DCount() on listbox rowsosurce to get number of rows
3. multiply by number in 1
4. adjust height - me.listbox1.height= <new value>

probably you have to compare possible heigh with form section height, you
cant make control higher then form section
 
Hcoms replied to Alex Dybenko on 18 May 2004
Thank you i just had to get the pixel height from the text to calculate the
new height.

Cheers

"Alex Dybenko" <Alex@No.cemi.SPAM.rssi.Please.ru> wrote in message
news:eD73uVLPEHA.3012@tk2msftngp13.phx.gbl...
 

Archived message: changing height of listbox based upon number of records (Microsoft Access Error Message)