I have a listbox on a report and in order to keep ithings tidy I want it to fit the contents. I found this piece of code:
Which dosen't work as I think it should, from reading the description it should count the amount of records and then set the height accordingly, but it seems to just set it bigger regardles of the amount of recored.
Can anyone see what is wrong please?
Code:
Dim getListboxCountBeaters As Integer
Dim setHeight As Integer
getListboxCountBeaters = Me.listBeaters.ListCount
' Adjust Number Accordingly
setHeight = 217
Me.listBeaters.Height = getListboxCountBeaters * setHeight
Can anyone see what is wrong please?