Solved

Error: The control or subform control is too large for this location.

Posted on 2006-07-11
3
1,928 Views
Last Modified: 2012-06-27
We have a legacy database application written in Microsoft Access 2003.  The system has been in use for years.  Several of our users have recently received new laptops (Dell D610).  With these new laptops, the users are now receiving the error message "The control or subform control is too large for this location" when they attempt to open some forms in the application.  Only users of this model of machine are receiving this error message.  I have made sure that the same version of Access is on these new machines.  Only machines of this model are having the problem.  I also verified that Windows fonts are the same as on other machines.  Any help would be appreciated.
0
Comment
Question by:jsprenk55
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
stevbe earned 500 total points
ID: 17083811
my guess is that you will find code behind the form(s) that looks something like ...

Private Sub Form_Resize()
    Me.ControlName.Width = 2878
End Sub

You should be OK by telling access to ignore the "too small error"

Private Sub Form_Resize()
On Error Resume Next
    Me.ControlName.Width = 2878
End Sub


0
 
LVL 39

Expert Comment

by:stevbe
ID: 17083860
You see this kind of erro when a dev hardcodes a specific size instead of using runtime size

if I was to make by comments textbox display across the entire width of the form ...

Private Sub Form_Resize()
On Error Resume Next
    Me.txtComment.Width = Me.InsideWidth
End Sub

if I also want it to fill the space from it's current top locatio to the bottom of the screen ...
Private Sub Form_Resize()
On Error Resume Next
    Me.txtComment.Width = Me.InsideWidth
    Me.txtComment.Height = Me.InsideHeight - Me.txtComment.Top
End Sub

it can get a bit more complex if you have a header sections ...
    Me.txtComment.Height = Me.InsideHeight - (Me.txtComment.Top + Me.Sections(acHeader).Height)

and then you amy also have a footer section ...
Private Sub Form_Resize()
On Error Resume Next
    Me.txtComment.Width = Me.InsideWidth
    Me.txtComment.Height = Me.InsideHeight _
                                         - Me.txtComment.Top _
                                        + Me.Sections(acHeader).Height) _
                                        + Me.Sections(acFooter).Height)
End Sub


Steve
0
 

Author Comment

by:jsprenk55
ID: 17091181
I took your recommendation to just ignore the error.  I added the below code to the program.  Thanks.

Err_Form_Load:
' The below if statement was added when we acquired the Dell D610 computer.  The error message would only appear on this model machine.
' The error message that was appearing was "The control or subform control is too large for this location".  By adding the below if statement
' This message will be suppressed and ignored.
    If Err.Number = 2100 Then
        Resume Next
    End If
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

23 Experts available now in Live!

Get 1:1 Help Now