Resizing a text box

  • Thread starter Thread starter Maracay
  • Start date Start date
M

Maracay

Hi Guys

I need to resize a text box, in my program I am using this instruction.
Forms!frmImpData!ID.Width = 3.5 the problem is that the text box almost
disappear, getting a width of 0.004 cm, there is a way to do this.

Thanks
 
Maracay said:
Hi Guys

I need to resize a text box, in my program I am using this instruction.
Forms!frmImpData!ID.Width = 3.5 the problem is that the text box almost
disappear, getting a width of 0.004 cm, there is a way to do this.


In VBA code, alll control measurements are expressed in twips, where 1 twip
= 1/20 of a point = 1/1440 of an inch = (I think) 1/567 of a centimeter. If
you want a width of 3.5 cm, set the .Width property to 1984 or 1985,
depending on how you want to round off the difference.

If you meant 3.5 *inches*, then set the .Width to 5040.
 
I just use a function to convert the inches to twips:

Public Function fnTwips(Inches as double) as integer

'Returns the number of twips in the # of inches passed
fnTwips = Inches * 1440

End Function

Then, in you code, use:

Forms!frmImpData!ID.width = fnTwips(3.5)

This is probably not as effient (by microseconds) as doing the computation
and putting the number in there instead of calling the function, but it makes
it clearer what you are trying to do, which is helpful for maintenance
purposes.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
Back
Top