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

Setting screen area 2

Status
Not open for further replies.

RobbieD

Programmer
Mar 19, 2003
12
GB
I have just built an access database which is used by different users throughout the day on different machines. Because all the users set ups are different many of the database forms don't fit on some of the screens or they appear to small on others. Is there a way of setting the machines screen area when the database is opened and reset it on close to elliminate this problem? Please help to stop the users from moaning about this. . . .Thanks
 
I create my forms to fit the smallest resolution for which my user's have their machines set. For example, the lowest resolutions some have theirs set at is 800x600. While others have it set to 1024x768. Consequently, I develop my forms to fit 800x600. And when I open the form it is maximized. However, if the resolution is greater than 800x600, I open the forms restored and centered rather than maximized. Here's how I do it.

I create a module and name it basPublicDeclarations. This is where I declare all of my public variables. Therefore, the following public declaration would be declared in this module.

Public Declare Function FP_apiGetSystemMetrics Lib "User32" Alias "GetSystemMetrics" (ByVal nIndex As Integer) As Integer

In the OnActivate event of the form, I include the following code.

If (FP_apiGetSystemMetrics(16) <= 800) Then
DoCmd.Maximize
Else
DoCmd.Restore
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top