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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone know how to Resizing forms? Urgent

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I need to find code that will help resize the forms in access 2000 due to the computer that the database is on have different resoultions. In turn makes the form all too big. They were created in the following resoultion (800 by 600 pixels).

Tig [puppy],
 
You can reference the forms height and width properties in the VBA code. For example if your form's name was frmTest the code would be:

Form_frmTest.width = 640
Form_frmTest.height = 480

I am not 100% sure about a function that would check different resolutions but that would be good for an if statement to set up different combinations of sizes.

Just an idea.

Steve Carrier
 
SteveCarrier,

Where are you placing the code? With Access2000 you can't set the height in the properties. You can set window properties as far as heights and widths. I don't know where you would do that either.

Tig [puppy],
 
Tig,

I would place the code in the Form_Load event for whatever form you want to resize. The code them becomes quite simple:

Me.Height = 480
Me.Width = 640

Hope this helps!

Steve
 
This has been done!

' From Access 97 Developer's Handbook
' by Litwin, Getz, and Gilbert (Sybex)
' Copyright 1997. All rights reserved.

Check out this book, it comes with a CD containing a bunch of useful code, which I have found to work beautifully with Access 97 and 2000.

It checks the screen resolution and scales everything on the form. You put some code in the form's on_open event to call the code modules basFormGlobal and basFormScale.

The code is long and involved, obviously written by someone with a lot of talent and "a lot of time on their hands". It works and it's free. Be sure to include the credits (example above)
 
DK77,

Thank you, I have this book and I have been looking at that code all day. I was not sure if it would work with access 2000. Now you have confirm this that is what I am going to do.

Tig [puppy],
 
How about changing the user's resolution to 800x600 when the database is opened, restoring the original resolution on exit? This way you dont have to write code to scale up/down evry form in your databse.

Morcelli
 
morcelli,

Your suggestion interests me. Could you tell us how to programmatically change the user's resolution? I am guessing this is a Windows API call.

I buy "geek books" all the time that give details of some API calls and how to implement them in Access with VBA, but I haven't seen anything about this particular one.

I've noticed too that when I change from one resolution to another and back manually in Windows, my Desktop icons get moved all around and I find that annoying. I wouldn't want to annoy users of my applications with anything like that...comments?



 
Morcelli,

I would be interested in your suggestion. How would I go about doing this and will it move the icons around on the desktop that dk77 asked? Could you show me the code and where you are placing the code?

Tig [puppy],
 
The code that dk77 referenced from :
' From Access 97 Developer's Handbook
' by Litwin, Getz, and Gilbert (Sybex)
' Copyright 1997. All rights reserved." is long and complicated but it does work in 2000 and it works beautifully. The ezapp builder suite available from database creations also has the code precoded and ready for easy import. I use it on all my aps and I think it adds polish and professionalism. The code is only needed one time and declare it public and call it on the onload event from all your forms. The best part is it resizes controls, pics subforms etc. and can be portable. I can't imagine setting a users resolution to 800 x 600 when they installed it on their laptop .......

Take the time to write the code, put it in your private library and use it over and over again.
 
tammyf1964,

where is this ezapp builder suite located? Can you send the link to it? Or show me what you got?

tig [puppy]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top