Solved

Screen Resolution

Posted on 1997-12-09
8
2,374 Views
Last Modified: 2012-05-07
I have written a few custom apps in 1024 x 768 resolution which are now being transferred to laptops and older desktops supporting only 640 x 480 or 800 x 600 resolution. My question, Is there a conversion code module for Access ver. 2 that recognizes screen resolution and converts apps to the proper settings for various resolutions.Also does a newer version of Access address this problem, if so I will upgrade. Any help will be greatly appreciated and thanks in advance.
RomeFU12@aol.com ( John )
0
Comment
Question by:RomeFu12
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 7

Accepted Solution

by:
spiridonov earned 100 total points
ID: 1961859
Here is a function from MS Knowledge base that gets screen resolution
1. Create a new module, and type the following Declarations and function:
 
      '
      *****************************************************************
      ' DECLARATIONS SECTION
 
      Option Explicit
 
      Type RECT
          x1 As Integer
          y1 As Integer
          x2 As Integer
          y2 As Integer
      End Type
 
      Declare Function GetDesktopWindow Lib "User" () As Integer
      Declare Function GetWindowRect Lib "User" _
         (ByVal hWnd As Integer, rectangle As RECT) As Integer
 
      '
      *****************************************************************
      ' FUNCTION: GetScreenResolution()
      ' PURPOSE:
      '   To determine the current screen size or resolution.
      ' RETURN:
      '   The current screen resolution. Typically one of the following:
      '      640 x 480
      '      800 x 600
      '      1024 x 768
      '
      *****************************************************************
      Function GetScreenResolution () as String
          Dim R As RECT
          Dim hWnd As Integer
          Dim RetVal As Integer
          hWnd = GetDesktopWindow()
          RetVal = GetWindowRect(hWnd, R)
          GetScreenResolution = (R.x2 - R.x1) & "x" & (R.y2 - R.y1)
      End Function
 
2. From the View menu, choose Immediate Window.
 
3. Type the following line in the Immediate window, and then press ENTER:
      ? GetScreenResolution()
The current screen resolution will be displayed in the Immediate window. If the current resolution is standard VGA, the following will be displayed in the Immediate window:    640x480

The functions to resize the form : glrScaleForm() and glrResizeForm() functions, written by Ken Getz, are
published in the following book:
    Microsoft Access 2 Developer's Handbook. Ken Getz, Paul Litwin,   Greg Reddick. Sybex: 1994 ISBN: 0-7821-1327-3
 These functions were also published  in Smart Access magazine.
   Article: "Create Resolution-Independent Forms in Access 2.0" by Ken Getz    Smart Access, June 1994

0
 
LVL 12

Expert Comment

by:Trygve
ID: 1961860
spiridinov: If you have access to the resize functions please post them as comments as this would make this answer complete. Not everyone reading this answer can get hold of the book or magazine mentioned.
0
 
LVL 7

Expert Comment

by:spiridonov
ID: 1961861
If i had them, i would for sure have posted them.
0
 

Author Comment

by:RomeFu12
ID: 1961862
I have already been to the knowlege Base and have obtained the determining current screen resolution code.I have heard of this book but I am not able to locate a copy. Also I have intecepted E-Mail noting that the resize code module does exist and is out there somewhere in some experts module library. Anyone know where I can obtain a copy? And does a newer version of Access address this problem?
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:RomeFu12
ID: 1961863
Pleae submit my question again to other experts after posting my comment.
Thanks again
RomeFU12@ aol.com    (John)
0
 
LVL 3

Expert Comment

by:fordraiders
ID: 1961864
An Access97 database is now available on cd-rom, from the book: Access97 Developer's
Handbook third edition. page 474. The  access97 database is on the cd-rom with the book. "chap 08".
1. Make sure your fonts are scalable. (true type)
2. Put the modules from the cd-rom on all your forms "Open Event"
3. There are two:      basFormScale   and   bas FormGlobal.
Its a great book.
Hope this helps!
0
 
LVL 3

Expert Comment

by:fordraiders
ID: 1961865
An Access97 database is now available on cd-rom, from the book: Access97 Developer's
Handbook third edition. page 474.SYBEX. The  access97 database is on the cd-rom with the book. "chap 08".
1. Make sure your fonts are scalable. (true type)
2. Include two modules to your database:  basFormScale   and   bas FormGlobal. from cd-rom
3. Declare a data structure in the form module of each form. To hold the size information of your form.
Dim rctOriginal As adhTypeRect
4. Attach  a call event to forms resize event "adhResizeForm"
5. Attach a call the the forms open event "adhScaleForm"
The rest is explained in full in the book
Its a great book.
Hope this helps!
0
 
LVL 12

Expert Comment

by:Trygve
ID: 1961866
I guess you couldn't post these functions/modules here ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now