Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

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????
0
wlwebb
Asked:
wlwebb
  • 3
2 Solutions
 
mbizupCommented:
You need to multiply inches by 1,440 to convert to TWIPS....

1.635 * 1440
0
 
mbizupCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now