Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making forms open to fit screen size

Status
Not open for further replies.

mairtin

Technical User
Feb 17, 2009
5
IE
Is there a way to make a form open so that it automatically fits the screen size of any computer that the database happens to be loaded on?

I am working on a database on my laptop, which I occasionally transfer to my PC

I find that the forms, which fitted my laptop screen perfectly, do not fit properly on the PC screen, for example a form may not be fully visible on one screen

Then I have to go tinkering with it in design view to adjust the width etc. so that you can see the entire form on one screen

There has to be a simple solution to this, anyone?
 
One of ways inwhich I open my forms and reports in Access (to full screen) is to use the below code in "On Open"

Docmd.maximize

To reduce the size of the screen when you exit (handy for dialog box forms/switchboards is the following code entered into "On Close"

Docmd.restore

Hope it helps and is what you wanted.
 
Owenhall,

Thanks for your reply

Unfortunately your suggestion doesn't work for me. I should rephrase my problem as "trying to make the form automatically fit the screen no matter what computer the database is subsequently opened on".

When I create a form in a database on one computer, e.g. a laptop, I usually use a macro to maximise the form on opening and the form fills out to fit the screen perfectly -more or less as you suggested.

However if I later transfer the same database to a PC the size of the form is all wrong and if I want to get it to fit the screen I have to do it manually in design view and move and resize the controls etc.

I'm thinking, this cannot be right, there must be a fix for this. Has anyone else encountered this problem?

 
Mairtin

You have came across one of Access's few pitfalls.

I am going to guess that your PC screen setting is 800 by 600 and your lap top is 1024 by 768 pixels.
There are some programs out there that claim to change your form sizes to fit what ever size screen setting. eg; Shrinker Stretcher
They charge for these programs and I don't think they work that well.

Your best bet is to set all your computors to the same size screen settings and build your forms that size.

Hope that helps
Tom
 
Tom,

Many thanks for this information

This problem was getting to be a real nuisance.

Setting the computers to the same settings (no of pixels?) sounds like a neat and practical solution and should reduce my stress levels somewhat.


Mairtin
 
Tom,

Many thanks for this information

This problem was getting to be a real nuisance.

Setting the computers to the same settings (no of pixels?) sounds like a neat and practical solution and should reduce my stress levels somewhat.


Mairtin
 
Mairtin,
When you only have your own computers to concern yourself with, setting the sceen resolutions are an easy way to "fix" your issue. However, to truly fix the issue, you need to set a procedure that handles the screen resolution no matter what it is set at.

As a "visitor" I am not sure you want to get into the real nitty gritty of programming code to handle the issue or not, but there is a terrific procedure that handles Scaling and Resizing forms to fit every screen resolution available from Access 2000 Developer's Handbook. (Other versions have the same solution as well)

Visit for more information on the books and the authors. Scale and Resize Your Access Forms Page 1 From Access 2000 Developer’s Handbook, Volume I (Desktop Edition) ISBN 0-7821-2370-8 by Ken Getz, Paul Litwin, and Mike Gilbert
©Sybex, Inc. All rights reserved. Because so many Access developers need this functionality, we’ve decided to release a protected version of the form resizing code that’s available as part of Access 2000 Developer’s Handbook, Volume I. Included in this package you’ll find a number of files:
• This document, in PDF format.
• ADHResize2K.MDE (the version for Access 2000)
• ADHResize97.MDE (the version for Access 97)
• ADHResizeTest2K.MDB (a sample database for Access 2000)
• ADHResizeTest97.MDB (a sample database for Access 97)

I have used their code in a number of my Access applications and it works every time. It is relatively easy to use for a programmer or Power technical user, but may have some challenges for a newcomer to Access.

Good Luck!
Bryan Bryan Meek
bmeek@adelphia.net
A "Solution Provider" in your corner gives you the personal attention you need to find the right technology solutions for your business.
 
Bryan

Many thanks for this info

I can see that in some situations this would be an attractive option

However I am not sure if I can handle it but I will certainly browse through it and see

Regards


Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top