How to position a pop-up subform in relation to the main form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sueb
    Contributor
    • Apr 2010
    • 379

    #1

    How to position a pop-up subform in relation to the main form?

    I have a subform that pops up when requested by a button on the main form. Is there a way that I can specify exactly where it displays in relation to the main form?
  • slenish
    Contributor
    • Feb 2010
    • 283

    #2
    Use the Command in the OnOpen of the subForm

    DoCmd.MoveSize 0,0,0,0
    ..............[Right/left],[up/Down],Width,Height

    Comment

    • sueb
      Contributor
      • Apr 2010
      • 379

      #3
      Great! What are these units? Pixels? Inches?

      Comment

      • slenish
        Contributor
        • Feb 2010
        • 283

        #4
        They are called Twips. 1/1440 of an inch.

        So for example in the first 0 the larger the number it will move the form more to the right side of the screen the smaller the number it will move it more to the left. same with up and down and so on. You will have to play around with it some so you can see how it works.

        try doing something like this

        DoCmd.MoveSize 10, 300
        or
        DoCmd.MoveSize 10000, 3000

        you will see the differences.

        Comment

        • sueb
          Contributor
          • Apr 2010
          • 379

          #5
          Great! I calculated exactly how big and where I wanted my window to be, and it came out perfectly--thanks!

          Comment

          • slenish
            Contributor
            • Feb 2010
            • 283

            #6
            Your Welcome :D

            Comment

            Working...