Solved Center a Form on the screen with VBA (1 Viewer)

yamus

Member
Local time
Today, 11:58
Joined
Aug 12, 2020
Messages
81
Hello
How can I center an access form on the screen for different display resolutions?
I tried auto center property from design mode but this property centers the form only horizontally
Thanks in advance
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:58
Joined
May 7, 2009
Messages
19,247
open form1
 

Attachments

  • formCenterToScreen.accdb
    512 KB · Views: 1,067

isladogs

MVP / VIP
Local time
Today, 11:58
Joined
Jan 14, 2017
Messages
18,247
Just checked.
The code in the file uploaded by @arnelgp is by Richard Bompuis and is the same as that in Form4 of my example app.
It works well enough for popup forms but is off centre for standard forms.

The best approach will vary depending on the type of form used and whether the ribbon/nav pane are hidden, minimised or'maximised'
 

yamus

Member
Local time
Today, 11:58
Joined
Aug 12, 2020
Messages
81
Just checked.
The code in the file uploaded by @arnelgp is by Richard Bompuis and is the same as that in Form4 of my example app.
It works well enough for popup forms but is off centre for standard forms.

The best approach will vary depending on the type of form used and whether the ribbon/nav pane are hidden, minimised or'maximised'
I tried it and it worked
Once again, I appreciate the help
 

isladogs

MVP / VIP
Local time
Today, 11:58
Joined
Jan 14, 2017
Messages
18,247
On behalf of us both, you're welcome whichever solution you used
 

Users who are viewing this thread

Top Bottom