Results 1 to 7 of 7
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    centre form on screen

    Hi

    have several forms in the database and in each under form proporties I have set auto center to yes.

    When each of the forms is opened the form is show top left ie from point 0,0



    How do I get the form to show up in the middle?

    thanks

    Ian

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    the form either needs to be popup or modal or if neither of these, in the db properties (File>Options>Current Database) set the Document Window Options to Overlapping Windows

  3. #3
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    thanks for the reply, the latter suggestion works but does look "messy" as every button press seems to move the form.

    When I do this in HTML I can get it to centre and maintain position when changing screens.

    I'll have to keep experimenting

    thanks

    Ian

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    When I do this in HTML I can get it to centre and maintain position when changing screens.
    what is the code for ding this? You could write equivalent code in VBA to achieve the same thing.

    Not sure what you mean by every button press moves the form - it should only move if you drag it.

    Just a thought - are you developing a desktop or web app - I don't use it myself but understand the latter is quite limited in what you can do

  5. #5
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    I'm writing a desktop applications,

    I did find some VBA code to put in the form on load event

    Code:
    Private Sub Form_Load()
    
         me.move (Screen.Width - me.Width) / 2, _ 
         (Screen.Height - me.Height) / 2
    
    End Sub
    which sort of made sense to me but it throws up an error

    "method or data member not found"

    which I am researching.

    In any web sites I design I always make sure that between screens there is no jumping of fixed items such as menus.

    Centralising using CSS is relatively simple as there is a
    Code:
    center
    command so I don't see how this can be used in a desktop database.

    Although I suppose you could run a web database from a cd using WAMP? However thats a bridge to far for me at the moment

    cheers

    Ian

  6. #6
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I always make sure that between screens there is no jumping of fixed items such as menus
    If this is what you are experiencing then sounds like either your forms are different sizes or the same buttons are not in the same location on each form.

    The screen object is an access object, not a windows object which is what I think you want.

    The form will need to be located within the access window - it can only be located outside of this if it popup and/or modal

    you may also find this link useful

    https://msdn.microsoft.com/en-us/lib.../ff845906.aspx

  7. #7
    Jen0dorf is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    thanks for the link

    Ian

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

Similar Threads

  1. Replies: 1
    Last Post: 06-10-2014, 05:15 AM
  2. Replies: 4
    Last Post: 09-13-2011, 03:16 AM
  3. Replies: 11
    Last Post: 06-05-2011, 09:51 PM
  4. annoying error! trust centre?
    By tom4038 in forum Import/Export Data
    Replies: 1
    Last Post: 09-23-2009, 11:26 AM
  5. centre justify column text
    By marky in forum Access
    Replies: 0
    Last Post: 09-01-2008, 12:02 PM

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