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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

calling a form 1
Memo Box Resize in Form View 1
Resizing a field on the fly 4
Can not get size of list width 2
PowerPoint powerpoint text Overflow 0
changing size of textbox to match form 16
Resizing locked text box 1
Resizing the form 1

Back
Top