View Full Version : Programatically Move Report Control


GaryAF
07-28-2008, 02:38 PM
I want to programatically move a report label down on the page at run time. Seems like it should be the easiest thing I'll do all day using the top property, except when the lines of code

intTopValue = 900
Me.TotCount_LABEL.Top = intTopValue

execute, I get

"...The setting you entered isn't valid for this property..."

I'm attempting to do this inside a group footer.

I'd appreciate any suggestions....

ajetrumpet
07-30-2008, 04:42 PM
these are very interesting properties Gary. You can move objects simply by specifying what you have in code. However, if you have set intTopValue to an integer, you must be invalid because of these twips unit of measurement.

Control location properties are valued in twips in visual basic. 1440 twips to an inch (I think). For instance, you can move a control like this:me.control.top = 1440But, I believe that if your control is inside of a footer, the TWIPS you enter for the spec will be relevant to the dimensions of that area, such as the top of the group footer for the TOP property. Thus, entering 1440 for TOP in a control footer will put it 1440 twips from the top of the actual footer area, not the form..

GaryAF
07-31-2008, 11:32 AM
Thanks for the response. I solved my problem with two modifications:

1. Changed the integer variable that defined the new distance from the top of the footer to a simple numeric constant (e.g., me.control.top = 800).

2. Moved the logic from the footer onPrint event to the onFormat event.

ajetrumpet
07-31-2008, 03:02 PM
good for you. you're welcome :)