Set Subform's Top Property via VB Code

Hello all!

I have a Form (not a tabbed form this time).  On that Form I have 4 subforms.  Based upon a Frame option group certain of these subform's will be made visible.  However I would like to set the Top property of the subform when the AfterUpdate of the option group is selected.

The Mainform has a header.  Where I want the subform Control to appear is at 1.635" down within the Detail section.  So I attempted.

Me![subform].Top = (me.formHeader.Height + 1.635)  

However, this doesn't work.  Is there a way I can set that Subform's Top setting with Code????
wlwebbAsked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
You need to multiply inches by 1,440 to convert to TWIPS....

1.635 * 1440
0
 
mbizupConnect With a Mentor Commented:
Also, I don't think you need to include the height of the header section.

The measurement (I think) begins in the section where your control is located.


Me.subform.Top = 1.635 * 1440
0
 
wlwebbAuthor Commented:
That was it!!!!!!!!!!!

And you ARE in fact correct .... the height didn't need to be in the formula!!!!!

Thanks mbiz
0
 
mbizupCommented:
Glad to help!

Your syntax was fine... but without the conversion your subform was moving by a mere smidgen.  :-)
0
All Courses

From novice to tech pro — start learning today.