Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I specify listbox height in twips

Status
Not open for further replies.

rambleon

Programmer
Mar 6, 2004
130
IL
I want to give my listboxs grow and shrink properties by changing the height according to the listcount. I have the following code:

If myListbox.ListCount > 1 Then
myListbox.Height = myListbox.ListCount * 270
End If

Where 270 is the number of twips per line. I understand the units have to be in twips, but I don't how to specify this.
 
What is happening with your code? Where is your code running (what event)?

Twips is the default Scalemode for reports.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
The code is in the OnFormat Event of the Detail Section.
I discovered that the ListCount property is 0 or 1 regardless of how many items there are in the list, so this is my problem not the twips.
 
To convert to twips, multiply 1440 * number of inches.

YourListBox.Height = 2 * 1440
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top