Results 1 to 5 of 5
  1. #1
    ssailer is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2021
    Posts
    2

    MoveAndSizeWindow in macro is being ignored

    When I click a button on my form, I want a query to run, preview mode only. This is working fine. But I can't get the window to display correctly.

    This is what I currently have in my macro:


    MoveAndSizeWindow
    right: 1"
    down: 1"

    The width and height options are not recognized either. The query window still opens in the top left corner, ignoring the settings in the macro. Can you enter a percentage instead of an actual measurement?

    Thank you.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    If you are referring to a form, then try this
    MoveAndSizeWindow
    right: 1440
    down: 1440

    NOTE: The values above are in twips. There are 1440 twips in 1 inch

    Or better still use VBA.
    In the form_open event use
    DoCmd.MoveSize 1440,1440

    I doubt you can use this method on a query


    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

  3. #3
    ssailer is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2021
    Posts
    2
    Quote Originally Posted by isladogs View Post
    If you are referring to a form, then try this
    MoveAndSizeWindow
    right: 1440
    down: 1440

    NOTE: The values above are in twips. There are 1440 twips in 1 inch

    Or better still use VBA.
    In the form_open event use
    DoCmd.MoveSize 1440,1440

    I doubt you can use this method on a query


    Yes, I'm running/opening a query, which I want to display in a small window, centered on the screen. This occurs when I click a button on the form.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    In that case, open the query in a form
    OR... move/size the query to the position you want on the screen. Close & reopen. It will reopen to the same position. The macro will then be redundant.
    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
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Given that you shouldn't be presenting queries to users as datasheets, this is really should be a non-starter, no?
    The method applies to the active window, so it should work with a query datasheet view. If users move the window, then save, then close, it will open in that new saved position and size, so if that matters, best to stick with MoveSize IMO. Better yet, don't allow users to dabble in table or query datasheets.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-19-2017, 12:40 PM
  2. Replies: 7
    Last Post: 01-20-2017, 02:21 PM
  3. Replies: 1
    Last Post: 01-13-2015, 01:33 PM
  4. Replies: 2
    Last Post: 05-05-2012, 02:34 AM
  5. Replies: 0
    Last Post: 01-12-2011, 12:43 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