Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2248
  • Last Modified:

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

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
jsprenk55
Asked:
jsprenk55
  • 2
1 Solution
 
stevbeCommented:
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
 
stevbeCommented:
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
 
jsprenk55Author Commented:
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now