Solved

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

Posted on 2006-07-11
3
2,009 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

860 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