the control or subform control is too large for this location (1 Viewer)

sailorguy

Registered User.
Local time
Yesterday, 18:48
Joined
Jan 31, 2008
Messages
48
Hello,

I have a form which has an unbound listbox with a number of columns and currently about 100 rows, but I'm entering data and came across this error "the control or subform control is too large for this location".

Is this a limitation of the listbox? How could I get around this? I'm still rather new to databases, so hopefully there is a simple workaround.
 

missinglinq

AWF VIP
Local time
Yesterday, 19:48
Joined
Jun 20, 2003
Messages
6,423
I'm confused by your post as to what the number of rows in your Listbox has to do with entering data. Unless this is something new introduced in 2007, you don't enter data directly into a Listbox but rather into it's source table/query.

But, at any rate, the answer is no, the limit on rows in a Listbox is 65,536, if I remember correctly.

The error refers to the physical size of a control, i.e. the space it takes up on a form. Here's an explanation of the error:

2100 - The control or subform control is too large for this location. The number you entered for the Left, Top, Height, or Width property is too large or is a negative number. Reduce the size of the control or subform control, or enter a positive number.

Are you using code to set the size of the Listbox? If not, perhaps the form has become corrupt. You could try a new form then import the components into it, or better yet, a new blank database and import everything into it. This will sometimes get rid of corruption.
 

sailorguy

Registered User.
Local time
Yesterday, 18:48
Joined
Jan 31, 2008
Messages
48
Hi,

Thank you, I wasn't clear. The listbox is being populated by various combo boxes on the form. I am using the following code to increase the height of the listbox as more rows are entered. I take it that is the problem then? Will I have to remove this code to continue?

Code:
getListboxCount = Me.List30.ListCount
' Adjust Number Accordingly
setHeight = 217

Me.List30.Height = getListboxCount * setHeight
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 00:48
Joined
Sep 12, 2006
Messages
15,660
normally you dont change the height of a listbox - since it will then overlap other screen items, or may indeed overfill the screen (which is probably your problem)

instead, just leave it designed at a reasonable space

access will
a) add scroll bars to let you see all the records and
b) as you type a selection value, access will "zoom" to the next matches for the character string entered
 

sailorguy

Registered User.
Local time
Yesterday, 18:48
Joined
Jan 31, 2008
Messages
48
I'm not sure about two equal posts....

I first wanted to know how to expand the list box as rows were added, which I learned thanks to that post.

What I discovered today, was that code had an unexpected problem which I know understand and can overcome. But thanks for your comment anyway. Some of us are learning as we go you know.
 

Users who are viewing this thread

Top Bottom