Resize form to suite screen resolution

DDonnachie

Board Regular
Joined
Jul 6, 2006
Messages
153
Hi folks,

I was wondering if anyone knew how to make access resize/scale its forms to suite the users screen resolution ?

I am using Access XP.

Any help you can give will be appreciated.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
You can get a lot of information about the system stuff from API calls. I would think that screen resolution would be one of them. Something that will at least give you the size of the screen, in Access measurements, where 1440 units = 1" would be this way.

Create a form with these properties:
..Scroll Bars: Neither
..Record Selectors: No
..Navigation Buttons: No
..Dividing Lines: No
..Border Style: None
..Control Box: No
..Min Max Buttons: None
..Close Button: No

Put this code in the Open Event:
.. DoCmd.Maximize
.. ScreenHeight = Me.WindowHeight
.. ScreenWidth = Me.WindowWidth

Put this code in the Timer Event:
.. DoCmd.Close acForm, Me.Name

Set the Timer Interval (on the "Event" tab within Form Properties)
.. To 500

This code will cause this form to fill the entire screen, then save the height and width into the two variables "ScreenHeight" and "ScreenWidth" (name them whatever you want and make them Global variables).
Then, depending on the size of the screen, you can change the size of your forms.

To change the size of a form, use the command DoCmd.MoveSize. The 3rd and 4th parameters to this command are Width and Height. This command will change only the active form unless you select another form with "DoCmd.SelectObject acForm, frmFormName, True". Be sure to change the "frmFormName" to your form's name. (Read the help associated with this command for more info.)
HTH,
 
Upvote 0
Sorry for not re-posting to this, as usual ended up be moved onto something else. I passed your reponse onto my co-worker and he was working at it using your solution and looking at various other ones.

Think he left the company before he got it satisfactorily resolved, for the amount of use it would get I wouldn't have started it anyway.

But thanks for the information anyway Vic.
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top