Controlling Opening Form Position in Microsoft Access with the MoveSize VBA Command

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024
  • In this Microsoft Access tutorial, you will learn how to use the MoveSize command in VBA to program and control the coordinates of forms when opening them. You will explore properties like Left, Top, Width, and Height to read and set the desired location and size of forms. This tutorial is aimed at those with prior VBA knowledge who need to maintain consistent form placement in their Access projects.
    Natalie from Carmel, Indiana (a Platinum Member) asks: How can I ensure that my Microsoft Access forms open in the exact location I want them to, even after making design changes? It seems like no matter what I do, Access opens the forms wherever it wants to. Is there a way to use VB code to program the form's coordinates so that it always opens in the specified location?
    Silver Members & up get access to an Extended Cut of this video. Members will learn how to create user-defined functions for dynamic form positioning. Whenever you save a form, the position is saved. Open it up, the position is loaded. We'll use a system settings table to keep positions for all forms in the database.
    MEMBERS-ONLY EXTENDED CUT VIDEO:
    • Controlling Opening Fo...
    BECOME A MEMBER:
    RUclips: / @599cd
    or My Site: 599cd.com/THMe...
    LEARN MORE:
    MoveSize: 599cd.com/Move...
    PREREQUISITES:
    Intro to VBA: 599cd.com/VBA
    Status Box: 599cd.com/Status
    LINKS:
    Access Save Position Template: 599cd.com/SavePos
    MEMBER LINKS:
    Open Form Right: 599cd.com/Open...
    System Defaults: 599cd.com/Syst...
    System Settings: 599cd.com/Syst...
    Form Positioning: 599cd.com/Form...
    RECOMMENDED COURSES:
    Access Developer 12: 599cd.com/ACD12
    Access Developer Courses: 599cd.com/Deve...
    FREE TEMPLATE DOWNLOADS:
    TechHelp Free Templates: 599cd.com/THFree
    Blank Template: 599cd.com/Blank
    Contact Management: 599cd.com/Cont...
    Order Entry & Invoicing: 599cd.com/Invo...
    More Access Templates: 599cd.com/Acce...
    ADDITIONAL RESOURCES:
    FREE Access Beginner Level 1: 599cd.com/Free1
    How to Use Access in 30 Minutes: 599cd.com/30Mi...
    $1 Access Level 2: 599cd.com/1Dollar
    Donate to my Tip Jar: 599cd.com/TipJar
    Get on my Mailing List: 599cd.com/YTML
    Contact Me: 599cd.com/Contact
    TechHelp: 599cd.com/Tech...
    Consulting Help: 599cd.com/DevNet
    Twitter: / learningaccess
    en.wikipedia.o...
    products.offic...
    microsoft.com/...
    KEYWORDS:
    access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, MoveSize, WindowTop, WindowLeft, WindowHeight, WindowWidth, VBA command, form coordinates, form placement, consistent form placement, Microsoft Access tutorial, form location, form size, MoveSize in Access, form properties, Left property, Top property, Width property, Height property, reading window properties, setting form location, setting form size, control form opening, VBA programming, form design, design changes, Access form opening, programming form coordinates, Access form coordinates, Access form location, Access form size
    QUESTIONS:
    Please feel free to post your questions or comments below. Thanks.
    Live long, and prosper.

Комментарии • 18

  • @amoskuluan4550
    @amoskuluan4550 14 дней назад

    On form design environment, set Auto Center to No. Then do the Cntrl Save during run time. It does the trick. I tried. It's working so far. Form is consistently loading on the position I wanted it to, I might be wrong. I am just subscriber, and I must say, this is the best channel for acess database programming so far. Thank you.

  • @vincentchikobe649
    @vincentchikobe649 Год назад

    Thank you Richard have been looking for that thanks once again!

    • @599CD
      @599CD  Год назад

      Glad to help

  • @Shadow.Dragon
    @Shadow.Dragon Год назад

    Richard, thanks for the great video! I was hoping you would do a video on just this topic. I'll definitely add it to my global module (after generalizing it). FYI, just noticed that your thumbnail shows "Me.WindowLeft" for the "Top" Status code.

    • @599CD
      @599CD  Год назад

      Good eye yeah I noticed that after I posted it LOL

  • @syedabbas201
    @syedabbas201 Год назад

    Excellent Video Dear Sir

    • @599CD
      @599CD  Год назад +1

      Many many thanks

  • @alializadeh8195
    @alializadeh8195 Год назад +1

    Thanks

  • @xavierbatlle1828
    @xavierbatlle1828 Год назад

    This week I came across we also can move the current form with the method "Me.move" and we also can test if it moveable with the property "me.moveable".

    • @599CD
      @599CD  Год назад +1

      Yep I'm actually got a video coming out about this soon you can make little buttons to move the current form around on the screen something like this: Me.Move Me.WindowLeft + 100. Each time you click that button and nudge the form just a little bit to the right.

  • @macfivo
    @macfivo 7 месяцев назад

    One more question: My database is on a tablet. When I touch a field and it opens up the on screen keyboard, the lower fields get covered up by the OSK. Is there a way to get the field to move to the top of the screen so that you can see what you are typing? And when you close the keyboard, it moves back? Or...maybe an unbound text box pops up to show what is being typed but then it goes away when the keyboard is closed down?

    • @599CD
      @599CD  7 месяцев назад

      No, that's not something you can really do with Access. The only thing you can really do is to design a form that fits on your tablet screen or your phone screen if you're using a phone that takes the space of the on-screen keyboard into account you're not going to be able to easily move it that's more of a feature of the tablet or the phone than of Access itself Access isn't really aware of an on-screen keyboard that's not something that they built into it yet and I honestly don't see it coming

  • @macfivo
    @macfivo 9 месяцев назад

    Rich, can you specify the position of a print preview with the same code?

    • @599CD
      @599CD  9 месяцев назад

      If memory serves I believe you can position a report using the same technique. Give it a try and let me know what happens.

    • @macfivo
      @macfivo 9 месяцев назад

      Yes, I tried it and it works perfectly! Thanks!@@599CD

  • @michaelkrailo5725
    @michaelkrailo5725 Год назад

    The bigger issue is with popup forms and one person has a single monitor setup, another has a two monitor setup, and some other user has three or four monitors. Suddenly, you have to create a bunch of different possible opening settings for every possible setup the users are using. PITA
    What I would like is to determine the current screen resolution and current monitor the main application is on and eliminate all of the coordinates from the monitors that do not have the main application. I kind of know how to do it, but it is a lot of work getting it to work correctly in all scenario's.

    • @599CD
      @599CD  Год назад

      Yeah that's a lot of work - another reason why I don't use pop-up forms