Positioning Pop Up Forms
We have seen the Pop up form in action last week in an Article with the Title: Synchronized Floating Pop up Form. I hope you have downloaded the Demo Database as well.
I know, I don’t have to talk at length about Forms and their importance in a database, because that is the first piece of object we would like to lay our hands on, the moment we decide to start learning MS-Access and wants to put all kinds of fancy objects all over the Form. MS-Access Forms are far better than Forms designed in Visual Basic.
There was an interesting incident in our office long back. A Visual Basic Application developed by our Computer Department was installed in one of my colleague's machine. My friend got a brief introduction from the developer before he left the scene. My friend started exploring the new Application.
I was sitting few workstations away from him and after about half an hour he called me and asked for some help. I was also very curious to have a look at the new Application. When I set my eyes on the screen I realized why he called me and he confirmed that too. I couldn’t resist a smile on my face and pat myself on my back for working with MS-Access Forms, even though I knew VB can do many things, which you cannot do in Access.
Few years ago most of the Computer Monitors were used with 640 x 480 Resolution and the Users preferred to maintain this way because dBase and Foxprow 2.5/3.0 based Applications were also running on their machines.
The VB Application’s Main Switchboard Form overlaps on all four sides of the Screen on my colleague’s machine and some of the Objects like Command Buttons and Option Group etc. at the edges of the Form are only partially visible on the screen. The Form was designed on a machine with a higher resolution without knowing where he is going to install it and ended up this way.
As far as I know, VB Form doesn’t have any Control Buttons (Min/Max, Restore and Close) on the Title Bar; no sizing handles, no Header/Footer Sections or able to define Pages and it looked like an oversize wooden board placed behind the screen frame.
I really felt few inches taller when positive remarks came from the Users of my MS-Access Databases.
Coming back to the point, we can change the behavior of the Form by setting its Property Values and we have seen several of them through earlier examples. We have set the Pop up Property Value to Yes in the previous Article to position the EmployeeSub Form above all other Forms.
When the Database Window is in maximized state if you open a normal Form it will also adjust itself to the maximized state. But, if the Pop up Property value is set to Yes then the form will open in its original designed size. This is true if you set the Border Style Property value to Dialog or Thin instead of setting the Pop up Property value. But, this will remove the Minimize/Maximize; Restore Window Buttons on the Title Bar. Setting the Border Style property value to None will remove the Title Bar totally.
It is a well known fact that all MS-Access Objects like Forms/Reports opens and stays within the MS-Access Application Window. You cannot take any of them out of the Application Window boundaries, right?
Wrong, you can, try this to find out:
- If the Access Application Window is in maximized state then click the Restore Down control button (the middle one between minimize/maximize and close buttons) on the Title bar and you will find a Window sizing control at the right bottom corner of the Application window. When you place the mouse pointer there it will change into a double-headed arrow. Click and drag the corner up, moving the mouse towards left top corner direction of the screen, so that the MS-Access Application Window reduces to about half of its size or make it even smaller. But you must be able to see one of your Pop up Forms in the database window and you are going to open it next.
- Open one of your Pop up Forms and you will see that it jumps out of the Application Window.
- If you didn’t make the Application window small enough then click on the Title Bar of the Pop up Form and drag it out of the Application Window. You can place both the Pop up Form and Application Window side by side or place the Pop up Form over the small Application window to hide it completely.
- Don’t attempt to minimize the MS-Access Application Window, if you do then the Pop up Form will jump in and hide. If the Application window is very small then the Pop up Form may open over the Application window hiding it completely.
Forms have another Property Auto Center. Usually this property is set to Yes along with the Pop up Property settings to make the Form to appear in the middle of the Application Window.
But, what do we do if we want the Pop up Form to appear in the top right corner or right bottom corner or any place other than the center of the Screen? There are no Property settings to make this happen. But there is a simple way to get this done, try the following method:
- Maximize the Application Window.
- Open a Pop up Form in Design View.
- Display the Property Sheet of the Form (View – ->Properties) and see that the Auto Center property is set to No.
- If the Form’s design frame is larger than the actual design size then reduce the design frame size by dragging the right bottom corner to the desired size.
- Click on the Title Bar of the Form and drag it to the right top corner (or any other position you prefer) and place it there.
- Click on the Save Toolbar Button or select Save from File Menu.
- Close the Design view of the Form
- Now, Open the Form in Normal View. The Form will appear where you have placed and saved it in design view.
Tip: This works not only for Pop up Forms, works on any Form.