Results 1 to 10 of 10
  1. #1
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110

    DoCmd.MoceSize


    I'm trying to place the help forms precisely in the window, so I am using the movesize command. It doesn't seem to be having any affect on the form placement.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Quote Originally Posted by willkr View Post
    I'm trying to place the help forms precisely in the window, so I am using the movesize command. It doesn't seem to be having any affect on the form placement.
    probably due to your code either being wrong or not firing for any number of reasons

    perhaps if you provided your code we could help to work out what the problem is

  3. #3
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Here's the code

    Private Sub Form_Open(Cancel As Integer)


    'SS_OnOpen Me
    DoCmd.MoveSize 8500, 3000




    ' Set the fonts
    Me.Title.FontName = strReleaseFontName
    Me.Text1.FontName = strReleaseFontName


    End Sub

    The numbers are in twips (20th's of pixels), so the upper left corner should be displaying at approx 425 pixels (5.9 inches) from the left edge and 150 pixels (2 inches) from the top. Instead it is 3 inches from the left and 2 inches from the top. Also, it doesn't move when I change the number of twips.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Is it a popup form? If so, the 8500 is relative to the whole screen.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Since you dont appear to be re-sizing the form couldn't you just use Me.Move 8500,3000 ?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Yes, it is a popup, but I am running it in full screen mode. I am using MoveSize only because that's what I have always used. I'll try me.move next.

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Yes, it is a popup, but I am running it in full screen mode.
    That does not make sense since you said 'Instead it is 3 inches from the left and 2 inches from the top.'. Full screen mode means it takes up the whole screen.

    Also worth clarifying what '
    3 inches from the left and 2 inches from the top' means - left and top of what? the monitor, the access window? a form?

  8. #8
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    The form that I did the MoveSize to ended up 3 inches from the left and 2 inches from the top of the screen because I have Access in full screen mode. I don't have the form in full screen mode, just Access.

  9. #9
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    movesize affects the active window - see this link

    https://github.com/MicrosoftDocs/VBA...md.MoveSize.md

    when a form is opened it is not necessarily the active window until the activate event

    see this link about order of events
    https://support.microsoft.com/en-us/...86553682f9#bm3

    perhaps try one or more of the following:

    1. moving your code to the form activate event
    2. opening the form as acDialog which may set the focus (and therefore the active status) sooner
    3. use the move property as suggested by moke123

    As an aside there are 15 twips to a pixel, 1440 twips to an inch and 72 pixels to an inch. So if you want 5.9 inches (exactly) that is 8496 twips which does not resolve to an exact number of pixels - you need a value of 8490 or 8505. I doubt it really matters in this case, but something you may want to be aware of

  10. #10
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Thank-you CJ. That was very helpful!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. DoCmd Run SQL
    By nick243 in forum Modules
    Replies: 13
    Last Post: 01-07-2019, 03:42 PM
  2. Replies: 2
    Last Post: 09-27-2016, 09:10 PM
  3. Replies: 1
    Last Post: 07-30-2015, 12:56 PM
  4. Replies: 6
    Last Post: 01-27-2015, 02:00 PM
  5. Replies: 10
    Last Post: 03-12-2013, 01:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums