move from top of page

move from top of page

am 10.04.2008 21:45:20 von u39419

Can anyone tell my why this isn't working?

Me![dt].top=(1440/2.54)*16.78-[DT Total]*0.4)

I want it so that for every 1 change in [DT Total], a rectangular box [dt]
moves 0.4 units closer to the top.

The 1440/2.54 changes the pixel measurment into cm then the box is moved to a
specific starting point when it is multiplied by 16.78.

Anyways, the numbers are correct for my use, but when [DT Total] changes, the
box dosen't move. It seems like if I try and use + or - it doesn't recognize
it.
Any ideas?
Thanks

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-ac cess/200804/1

Re: move from top of page

am 11.04.2008 18:58:08 von Kc-Mass

Hi,

What your equation evaluates to is: Me![dt].top =
((1440/2.54)*16.78) - ([DT Total]*0.4))

As I understand your comment the first part of the arithmetic,
((1440/2.54)*16.78) is in units of centimeters.

What is the unit of measure for ([DT Total]*0.4))?

Kevin



"noe1818 via AccessMonster.com" wrote in message
news:827bd9bf67f9b@uwe...
> Can anyone tell my why this isn't working?
>
> Me![dt].top=(1440/2.54)*16.78-[DT Total]*0.4)
>
> I want it so that for every 1 change in [DT Total], a rectangular box [dt]
> moves 0.4 units closer to the top.
>
> The 1440/2.54 changes the pixel measurment into cm then the box is moved
> to a
> specific starting point when it is multiplied by 16.78.
>
> Anyways, the numbers are correct for my use, but when [DT Total] changes,
> the
> box dosen't move. It seems like if I try and use + or - it doesn't
> recognize
> it.
> Any ideas?
> Thanks
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-ac cess/200804/1
>

Re: move from top of page

am 12.04.2008 20:29:39 von Salad

noe1818 via AccessMonster.com wrote:

> Can anyone tell my why this isn't working?
>
> Me![dt].top=(1440/2.54)*16.78-[DT Total]*0.4)
>
> I want it so that for every 1 change in [DT Total], a rectangular box [dt]
> moves 0.4 units closer to the top.
>
> The 1440/2.54 changes the pixel measurment into cm then the box is moved to a
> specific starting point when it is multiplied by 16.78.
>
> Anyways, the numbers are correct for my use, but when [DT Total] changes, the
> box dosen't move. It seems like if I try and use + or - it doesn't recognize
> it.
> Any ideas?
> Thanks
>
I guess this is response to your prior post.

I created a simple report with 2 textboxes in the Detail band. I named
them Text1 and Text2. The control source is ="Text1" for Text1 and
="Text2" for Text2. I then added a line item called Line1.

I figured I'd shift the text boxes up or down. I determined I'd have 10
levels. I placed Text1 higher than Text2 and entered in the OnOpen event
MsgBox "Text1 " & Me.text.Top & " Text2 " & Me.Text2.Top & _
"Diff " & Me.Text1.Top - Me.Text2.Top & _
"plus Textbox height " & Me.Text1.height
In my case, the height difference was was 45 twips. For moving up/down
10 levels the Detail band height must be at least 450 twips plus the
height of the textbox.

You mentioned earlier you wanted to connect the line between Text1 and
Text2. So here's the code for it. If you drop this code into the
report's code module it does just that.

Note: The lines
'change the 1/10 numbers to any number between 1 and 10
Me.Text1.Top = (1 * intHeightPerUnit)
Me.Text2.Top = (10 * intHeightPerUnit)
are the only lines that need to be changed. They reflect your unit
measure. Hope this helps.

Option Compare Database
Option Explicit

Dim intNumUnits As Integer
Dim intHeightPerUnit As Integer

Private Sub Report_Open(Cancel As Integer)
intNumUnits = 10 'max number of upward moves
intHeightPerUnit = 45 'twips to move upward

'determine the height of the detail band. Change
'your figures to suite your situation
Me.Detail.Height = (intNumUnits * intHeightPerUnit) + _
Me.Text1.Height
End Sub


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intNum As Integer
Dim intDiff As Integer

'change the 1/10 numbers to any number between 1 and 10
Me.Text1.Top = (1 * intHeightPerUnit)
Me.Text2.Top = (10 * intHeightPerUnit)

intNum = Me.Text1.Height / 2 'put line in center of textboxes

'initialize Line1
Me.Line1.Height = 0
Me.Line1.Top = 0
Me.Line1.Left = 0

'left starting point of line
Me.Line1.Left = Me.Text1.Left + Me.Text1.Width

'length of Line1
Me.Line1.Width = Me.Text2.Left - Me.Line1.Left

'top line
If Me.Text1.Top <= Me.Text2.Top Then
Me.Line1.Top = Me.Text1.Top + intNum
Else
Me.Line1.Top = Me.Text2.Top + intNum
End If

'determine height of Line1
intDiff = Me.Text1.Top - Me.Text2.Top

'determine if line should be slanted / or \ direction
Me.Line1.LineSlant = (intDiff >= 0)

Me.Line1.Height = Abs(intDiff)

End Sub

Rolo
http://www.youtube.com/watch?v=TgvKrzh93ug