Try resizing the window to fit the new form's width. The form size and the
window size are not the same thing.
Forms!frmOrders.Width = 10080
DoCmd.RunCommand acCmdSizeToFitForm
HTH,
Rob
>I have a form that shows what is normally needed by the user. I want to be
> able to click a button labelled 'Extend' to widen the form to the right,
[quoted text clipped - 3 lines]
>
> Forms!frmOrders.Width = 10080
Rob - that's perfect
thanks!
> Try resizing the window to fit the new form's width. The form size and the
> window size are not the same thing.
[quoted text clipped - 13 lines]
> >
> > Forms!frmOrders.Width = 10080
hello Rob - I spoke too soon. The 'more details' button works exactly as you
said it would, expanding the window to reveal 'more details' on the form's
right side. But the 'less details' button (both buttons are superimposed with
only one visible at a time) doesn't work. When I set the form width to, say
6000 then use DoCmd.RunCommand acCmdSizeToFitForm, the Window will not shrink
enough to hide any controls. It only will shrink to the right edge of the
furthest right textbox. I need to be able to cover these areas of the form.
Any more clues?
Thank you
> Try resizing the window to fit the new form's width. The form size and the
> window size are not the same thing.
[quoted text clipped - 13 lines]
> >
> > Forms!frmOrders.Width = 10080
Sophie - 03 Mar 2007 05:07 GMT
I think you are looking for something like this.
DoCmd.MoveSize 5440, 3400, 12000, 8150
Hope this helps

Signature
Thanks
Sophie
> hello Rob - I spoke too soon. The 'more details' button works exactly as you
> said it would, expanding the window to reveal 'more details' on the form's
[quoted text clipped - 24 lines]
> > >
> > > Forms!frmOrders.Width = 10080
roger - 26 Apr 2007 05:12 GMT
hi sophie
many thanks - exactly what i was looking for ! great !
cheers and until soon
roger
ballarat, australia
info@magictours.com.au
> I think you are looking for something like this.
>
[quoted text clipped - 30 lines]
> > > >
> > > > Forms!frmOrders.Width = 10080
Rob Parker - 03 Mar 2007 05:17 GMT
Hi Victoria,
You can't set the form width to less than the position of the right-hand
edge of the right-most control(s); although you may be attempting to do so
in code, the command will simply set the width to the minimum possible
width, rather than the actual value you specify (and no error is generated).
The SizeToFitForm command will always show these controls, and it will only
resize the form to the edge of these controls (even if they are hidden).
Rather than resizing your form, you should use the MoveSize command to
resize the window. This command takes up to four parameters - right, down,
width, height; any parameters omitted are not changed. For example:
DoCmd.MoveSize , , 2000
will resize the window to 2000 twips wide, without changing its position or
height.
If your form has scrollbars enabled, the resize (to a narrower width) will
probably cause a horizontal scrollbar to appear. You can prevent this by
setting the form's scrollbar property to either Vertical or None.
HTH,
Rob
> hello Rob - I spoke too soon. The 'more details' button works exactly as
> you
[quoted text clipped - 33 lines]
>> >
>> > Forms!frmOrders.Width = 10080