?
Solved

Access2003 - Workable area based on screen resolution

Posted on 2006-11-16
4
Medium Priority
?
257 Views
Last Modified: 2008-01-09
Hi All,

I have an Access2003 database that changes the form / sub-form size based on the screen resolution.  However, the problem is that I am using fixed values based on the screen size.  I really want to be able to stretch the forms based on the usable area for each PC.  By this I mean the actual usable height from the top of the screen to the Taskbar.  If I can figure this out, I can program the size to fit - regardless of the situation.   The width shouldn't really be an issue as most of my clients have the task bar at the bottom, but some have this locked, unlocked, or hidden when not in use.

Most of my clients are using Windows XP, but some are still running 2000.

Any suggestions would be really appreciated.
0
Comment
Question by:Andy Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 85
ID: 17954774
Do you mean you want your forms to fill the entire Access area? You can do this by issuing a DoCmd.Maximize in the form's Load or Open event.

Do you mean you want to resize your forms based on the screen resolution? Access forms expose a Resize event where you can do this, but it's a fairly huge task. You might be better off purchasing a 3rd party resizer and using that. Most 3rd part resizers provide font resizing, etc:

http://www.peterssoftware.com/ss.htm
http://www.jamiessoftware.tk/resizeform/rf_jump.html (this one's free)
http://www.fmsinc.com (includes one as part of their Total Access Compnents package)

Finally, the Developer's handbook provides code which you can use to build your own:
http://www.amazon.com/exec/obidos/I...8064361-7403703
0
 
LVL 85
ID: 17954781
0
 
LVL 39

Accepted Solution

by:
stevbe earned 2000 total points
ID: 17954811
If you only want to change the width and height of the forms (and not mess with font size) it is fairly easy to do main form / subform sizing. The key is to use the .Insideheight and .InsideWidth to get the runtime width and height of your main form.

in the main form open event I maximize the entire application...

Private Sub Form_Open(Cancel As Integer)
    DoCmd.RunCommand acCmdAppMaximize
End Sub

then in the main form resize I fix up the subform (and in this example I have a Notes field that is Memo)
'-------------------------------------------------------------------------------
Private Sub Form_Resize()
'-------------------------------------------------------------------------------
'   enable custom error handling
    On Error GoTo ErrHandler
'-------------------------------------------------------------------------------
   
    'size the notes field to fill the screen
    Me.txtBudgetNote.Width = Me.InsideWidth _
                             - Me.txtBudgetNote.Left _
                             - 30
   
    'size the discipline subform to fill the screen
    Me.childDiscipline.Width = Me.InsideWidth _
                               - Me.childDiscipline.Left _
                               - 30
    Me.childDiscipline.Height = Me.InsideHeight _
                                - Me.Section(acHeader).Height _
                                - Me.Section(acFooter).Height _
                                - Me.childDiscipline.Top _
                                - 30
   
'-------------------------------------------------------------------------------
ExitHandler:
    Exit Sub
'-------------------------------------------------------------------------------
ErrHandler:
    Select Case Err.Number
        Case 2100   'ignore, user made form too small, Access wil handle this
        Case Else
            LogError ErrLogMod:="frmBudget", _
                     ErrLogProc:="Form_Resize", _
                     ErrLogNo:=Err.Number, _
                     ErrLogDesc:=Err.Description, _
                     ErrLogDisp:=True
    End Select
    Resume ExitHandler
'-------------------------------------------------------------------------------
End Sub
'-------------------------------------------------------------------------------

0
 

Author Comment

by:Andy Brown
ID: 17955287
That's perfect - I wish I'd seen that command before.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

764 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