Solved

Access2003 - Workable area based on screen resolution

Posted on 2006-11-16
4
256 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 500 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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