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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable height labels

Status
Not open for further replies.

misterstick

Programmer
Apr 7, 2000
633
GB
Access 2003 (11.6566.8036) SP2.

i'm writing an app that builds forms-based questionnaires from data.

i'd like the format to be in rows of controls, with a column of labels on the left and a corresponding column of data entry controls on the right.

i've got to the point where i can add the controls to the form, locate them on the form appropriately, and link them to each other and the data.

my problem is that CreateControl does not automatically set the height of a label if the contained text is too wide for the supplied width. since the question text is pretty long this means that the text on the label is truncated.

does anyone know how to work out the height of a piece of text given a width?
is there a way to autoset the height of a label control?

many thanks,


mr s. <;)

 
misterstick,
Here is a thread that covers moving and resizing text boxes, with a little work it could be adapted to labels.
[tab]thread702-1207991 : form display problem

This ueses a 'best guess' to deteremine the width needed for text based on the length of the text. I say 'best guess' because I have not seen a bulletproof method for determining the length of proportional text in VBA.

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top