move from top of page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • noe1818 via AccessMonster.com

    move from top of page

    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.c om


  • KC-Mass

    #2
    Re: move from top of page

    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.c om" <u39419@uwewrot e in message
    news:827bd9bf67 f9b@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.c om

    >

    Comment

    • Salad

      #3
      Re: move from top of page

      noe1818 via AccessMonster.c om 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 * intHeightPerUni t)
      Me.Text2.Top = (10 * intHeightPerUni t)
      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 intHeightPerUni t As Integer

      Private Sub Report_Open(Can cel As Integer)
      intNumUnits = 10 'max number of upward moves
      intHeightPerUni t = 45 'twips to move upward

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


      Private Sub Detail_Format(C ancel 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 * intHeightPerUni t)
      Me.Text2.Top = (10 * intHeightPerUni t)

      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.LineSl ant = (intDiff >= 0)

      Me.Line1.Height = Abs(intDiff)

      End Sub

      Rolo











      Comment

      Working...