[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Set Subform's Top Property via VB Code

Posted on 2013-01-05
4
Medium Priority
?
462 Views
Last Modified: 2013-01-05
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
Comment
Question by:wlwebb
  • 3
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 38747846
You need to multiply inches by 1,440 to convert to TWIPS....

1.635 * 1440
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 2000 total points
ID: 38747849
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
 

Author Closing Comment

by:wlwebb
ID: 38747854
That was it!!!!!!!!!!!

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

Thanks mbiz
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38747857
Glad to help!

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question