Open the form, click on Tools > Customize > Add Current Window to Visual Basic
Then click on Tools > Customize > Add fields to Visual Basic.
The cursor will change shape. Click on the 'expansion' button. Click on Tools > Customize > Add fields to Visual Basic again to cancel the add functionality (you're supposed to be able to hit 'escape' to exit, but it doesn't always work)

Click on Tools > Customize > Visual Basic Editor to open the VBA Editor
Choose 'Window' in the top left dropdown, and 'BeforeOpen' in the top right dropdown.
Enter the code shown.
That should do it. Comments?
