Postioning a text box with VBA code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box and label that I want to move and resize when a subform is
made visible. To begin with they are at the left margin and I want to move
them to 3.8
I have tried two ways and various numbers and doesn't work

Label29.Left = 3.8
or
with Label29
.Left = 3.8
end with

with Text1
.Left = 3.8
.Width = 4.0
end with
 
I have a text box and label that I want to move and resize when a subform is
made visible. To begin with they are at the left margin and I want to move
them to 3.8
I have tried two ways and various numbers and doesn't work

Label29.Left = 3.8
or
with Label29
.Left = 3.8
end with

with Text1
.Left = 3.8
.Width = 4.0
end with

Is that suppose to be 3.8 inches from the left margin?
You must convert your measurements into Twips... 1440 per inch.
Label29.Left = 3.8 * 1440
Text1.Width = 4.0 * 1440
 
I solved it myself. I saw something about twips so I changed the values to
5500 and everything positioned and resized correctly
 
Thanks fredg

fredg said:
Is that suppose to be 3.8 inches from the left margin?
You must convert your measurements into Twips... 1440 per inch.
Label29.Left = 3.8 * 1440
Text1.Width = 4.0 * 1440
 
Back
Top