Error On Resize

G

Guest

I've got a form with three objects: objExcel (an unbound object frame),
cmdEmail (a command button) and cmdDelete (a command button). The two buttons
are below the object frame.

I want to have the object frame expand down and to the right as the user
resizes the form. The buttons just need to keep their relative place under
the object. The below code is on the form's Resize event:

objExcel.Width = Form.InsideWidth - 280
cmdEmail.Top = Form.InsideHeight - cmdEmail.Height - 280 ' LINE 2
cmdDelete.Top = cmdEmail.Top

objExcel.Height = cmdEmail.Top - objExcel.Top - 280

Once the form gets to a certain size (around 7000 twips high or wide) this
code causes an error on line 2. The error is "The control or subform is too
big for the required area". What's confusing is that this error is ALWAYS
thrown on line 2, when I'm not even changing the size of the button, just
moving it up or down.

Any help?

I'm on AC2003/XP.
 
R

Rob Oldfield

Your problem is that, even though you are resizing the form, the actual
controls live on a section of that form and that section isn't being
resized. Hence, when the controls hit the bottom of the section, you get
the error. Try this...

me.section(0).height=form.insideheight
objExcel.Width = Form.InsideWidth - 280
cmdEmail.Top = Form.InsideHeight - cmdEmail.Height - 280 ' LINE 2
cmdDelete.Top = cmdEmail.Top
objExcel.Height = cmdEmail.Top - objExcel.Top - 280
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top