Change a Text or Combo Box under prog control

R

Ray C

I thought that I knew this but I must be wrong, please help.
I want to change various parameters of text / combo boxes and Labels under
prog control. The Form is called "Main" and i have tried the following to try
and change the parameters of a combo box called "cmb_Hdr_Select1" :-

Private Sub Form_Activate()

With Forms.Main.cmb_Hdr_Select1
.Left = 5
.Top = 2
.Width = 4.5
.Height = 1
.Visible = True

End With

' tried with and end with, then just calling the object by name

cmb_Hdr_Select1.Left = 5
cmb_Hdr_Select1.Top = 2
cmb_Hdr_Select1.Width = 4.5
cmb_Hdr_Select1.Height = 10

Neither seem to work. I must be doing something fundamentaly wrong, any help
appreciated.

Ray C
 
D

Duane Hookom

"Neither seem to work." I'm having trouble seeing the results of your
efforts. I expect your controls are very tiny. The default size and position
measures for controls on forms and reports is TWIPS. There are 1440 twips to
an inch. You might want to multiply your values by 1440 or whatever.
 
R

Ray C

Twips, Twips, where the $$$ does it tell you anything about Twips?? I know
that the Properties gives box measurements in "cm" but I tried adding all
kinds of "cm" to the program and it just crashes. So, what i need to do to
get a box 2 cm wide by 1 cm tall is to convert from cm to inches and multiply
by1440. Wow, who said access was easy.

Dane, Thank you so much for your help.

Ray C
 
D

Duane Hookom

Help states
"In Visual Basic, use a numeric expression to set the value of this
property. Values are expressed in twips."
 
D

Douglas J. Steele

It's not necessary to convert from cm to inches before converting to twips.
There are 567 twips to the centimter, so multiply the dimension in cm by
567.
 
R

Ray C

I stand corrected.

Thanks Duane


Duane Hookom said:
Help states
"In Visual Basic, use a numeric expression to set the value of this
property. Values are expressed in twips."
 
D

Duane Hookom

I wish the U.S. would have switched measure systems to metric back when I was
in grade school. Life would have been so much simpler.
 

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

Top