The control or subform control is too large for this location on resize

删除回忆录丶 提交于 2019-12-24 18:52:39

问题


I have a simple form in Access 2003. The form has a List control and a button. I wanted to make the list to resize with the form (only vertically) while the button remains at the bottom right of the List. I'm using the following code on the form's resize event.

list.Height = Me.InsideHeight - list.Top - 200
commandButton.Top = list.Height + list.Top + 50

This works fine as I resize the form, until the form height gets to a certain height. Then I get this error;

Run-time error '2100': The control or subform control is too large for this location

This error is occurring at the line where I'm assigning the commandButton.Top. If I remove this line then the list height changes fine. I don't have any subforms in the form.

Does anyone know why this is happening?

Thanks


回答1:


I think it is because you need to resize the detail section of the form first.

Try changing the code to

Me.Section(0).Height = Me.InsideHeight 
list.Height = Me.InsideHeight - list.Top - 200 
commandButton.Top = list.Height + list.Top + 50


来源:https://stackoverflow.com/questions/3447618/the-control-or-subform-control-is-too-large-for-this-location-on-resize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!