Solved

Set Subform's Top Property via VB Code

Posted on 2013-01-05
4
423 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 500 total points
Comment Utility
You need to multiply inches by 1,440 to convert to TWIPS....

1.635 * 1440
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Glad to help!

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

763 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now