Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2009
    Location
    Antwerp (Belgium)
    Posts
    33

    Unanswered: form positioning

    Please refer to the attached screenshot.

    The popup gets opened byt the before update of the "artikel" column. The grid is a subform contained in (continuous) subform control.

    I need to position the popup depending on the position of the input field.

    From the beforeupdate sub, I can determine the subform's coordiates (windowleft, windowtop), but the "activecontrol.left" and "activecontrol.top" both return 0

    At this stage, I'm afraid I have to position the popup form at design time which would take care of the position of the popup for the first line, and use the me.recordset.absoluteposition to determine the "top" for the other rows.

    Anybody has a better idea? Why can't I retrieve the position of the activecontrol at runtime?
    Attached Thumbnails Attached Thumbnails popup question.gif  

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can retrieve those coordinates, using the following syntax:
    Code:
    Me.Child1.Form.ActiveControl.Left
    Me.Child1.Form.ActiveControl.Top
    Where Child1 is the name of the subform control (not necessary the name of the subform).
    Have a nice day!

  3. #3
    Join Date
    Dec 2009
    Location
    Antwerp (Belgium)
    Posts
    33
    Thanks.

    In fact my issue was not how to get to the activecontrol position parameters but rather why they were 0.

    I am not calling the popup from the main form, but from a field in the continuous subform.

    My preferred syntax would then be :

    pnPopupLeft = Me.WindowLeft + Me.ActiveControl.Width
    pnPopupTop = Me.WindowTop + Me.ActiveControl.Top

    but both Me.ActiveControl.Width and Me.ActiveControl.Top seem to return 0 at runtime. They do not generate an compiling error though.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    This is strange because I don't have any problem retrieving the properties from the parent form or from the subform either.

    Please have a look at the attached database.
    Attached Files Attached Files
    Have a nice day!

  5. #5
    Join Date
    Dec 2009
    Location
    Antwerp (Belgium)
    Posts
    33
    You're right, and I understand my mistake.

    My continuous form mimicks a datasheet, and I'm calling the popup from the first column, which is a textbox at left = 0, top = 0. What I am looking for is a way to open the popup depending on the line the user is on. In fact that's always the same control and that's why always get the zero return.

    In fact what I'm looking for is a way to get the coordintes of the "current detail", detail does not seem to return it's coordinate (other than it's height) for some reason.

    Anyway, thanks for your upload. It has really helped at lot. Merci beaucoup
    Last edited by Marc Grajower; 01-05-10 at 20:51. Reason: typoes

  6. #6
    Join Date
    Mar 2004
    Location
    Huntington, IN
    Posts
    54

    Position forms on multiple monitors

    On a related note, I am using Access with multiple monitors.

    I am trying to move a form up and left when a subform opens.

    It always pushes it to another monitor. In fact, as a test, I had it show me the current position via msgbox. It reported something like (5000, 3000). I then moved it to 1,1 using movesize. Then I had it report its current position again (msgbox me.windowleft & me.windowtop).

    It moved it to the far upper left corner (logical for 1,1) but went to another monitor AND reported its position as -16000, -400.

    It did this even with the windows maximized to the monitor.

    Movesize is supposed to move relative to the open window, but the multiple screens must be a wildcard.

    Does anyone have any ideas? Or am I missing something obvious?

    Thanks!
    Matt Wilcox
    Casters & Wheels at www.apollocaster.com
    www.apollocaster.com/store

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •