PDA

View Full Version : Resize form w/code



Trevor
03-06-2008, 03:12 PM
I am trying to resize a form for estetic reasons but itsn't working
my form is 7.5 " high with a comment field(comment field disabled , and not visible as defalt), I am trying to set the form hight on open to 5.5 "" but it is not working code: onopen ()
Me.Detail.Height = 5.5

and on load the form does not change the hight.

after a command button is pressed the comment field will be visible and enabled and the form would the grow to accomadte, but I can't get it to resize on open or on load(using above code).
BTW: the form view is continious
any suggestions?
Thanks in advance

Tommy
03-06-2008, 03:33 PM
Just a guess cause I don't have anything to test it on before I say, in designview make the form 5.5" then reseet it to 7.5"

Me.Height = 7.5

EDIT: I still can't spell even with a spell checker.

Trevor
03-07-2008, 03:23 PM
I tried that believe it or not and when I save it as 5.5 and close and reopen the form and check detail it is defaulted back to 7.5

Tommy
03-07-2008, 03:45 PM
the me keyword is for the form

Me.Height= 7.5

or
Me.Detail is something else usually a control

Me.Detail.Height= 7.5

I am just making sure. :)

Trevor
03-08-2008, 09:15 PM
If I use me.Height = 5.5 I get unknown proporty error on height but if I use Me.Detail.Height = 5.5 then the compiler is happy with the argument but the hight does not change

Carl A
03-09-2008, 05:41 AM
Use the DoCmd.MoveSize. Numeric values are in twips 1440 = 1 inch

Trevor
03-09-2008, 08:27 PM
If I got it right DoCmd.MoveSize = 7920
this results in error "expected expression" If i use
DoCmd.MoveSize.7920 , the compiler just colors it red

Carl A
03-10-2008, 05:25 AM
The snytax for movesize is DoCmd.MoveSize ,right,down,width, height
so if you are wanting to change the height the command would look like this
DoCmd.MoveSize ,,,7920

Trevor
03-10-2008, 09:42 PM
thats works and dosen't work at the same time,
on open I have Dcmd.movesize,,,7920 works
but on one of my command buttons I have the size set to docmd.movesize,,,10800 witch chops the top 2" off the form, I have already tried setting form autoresize to yes and then no , saving the form to its full size in design view and no luck

Carl A
03-11-2008, 04:36 AM
Controls can be manipulated using their height, width and Top property. i.e.
text2.top = .5 etc

Imdabaum
04-04-2008, 12:21 PM
Is it feasible to use this same functionality to resize text fields on a report? I have one report where one comment cell is set CanGrow = Yes. I want to resize all adjacent fields to the same height as the comment's cell.

Trevor
04-05-2008, 10:12 AM
Imdabaum,
Yes it is

Imdabaum
04-10-2008, 09:05 AM
I'm trying to do it on the Detail_Format event. So far I'm trying
Dim reSize = Me.Properties("Text160").height

For each record
Me.Properties("Text135").Height = reSize
Me.properties("Text136").Height = reSize
(cont looping through each control for each record?)
Next record

Is that how I should go about doing it?
Dcmd.movesize isn't recognized in the IDE for _Format event code.

Trevor
04-10-2008, 10:57 AM
no, ex: Me.Text135.hight = number here