Center Control on form in design view

Today I had a control that I wanted to place right at the center of my popup form. I could get it roughly right in design mode, but just not 100% there.

Thankfully Access vba can be used to write developer helper functions as well as codes for the user interface. So I came up with this simple function that centers a control on a form, based on the width of the form. I used it while I had my form open in design view, and the button I wanted to center was selected.

 

Posted in Random Tidbits

Leave a Reply

Your email address will not be published. Required fields are marked *

*