Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Center calculated text box within detail

Status
Not open for further replies.

sxschech

Technical User
Jul 11, 2002
1,033
US
I have added a text box to my report so that the user can quickly tell if the values have gone up or down when comparing current month to the same month a year ago. The report is grouped such that each detail contains 2 rows. I would like the indicator text box to appear to display its results between the two, but not sure if the can grow property or some other property can accomplish, also rather than having the words "UP", "Down", "Unchanged" is there code to display arrows? I tried using the charmap and copy-paste to the code, but it only displayed an A with a circle above it. (Font used on report is Times New Roman)

Currently, display looks something like this:
[tt]
May-06 4
May-05 Up 3
-------------------------

May-06 7
May-05 Down 8
-------------------------
[/tt]

Would like the Up/Down to appear either between the 06 and 05 or on the 06 row at worst case.

Here is the code, excuse the poor names as it's a quick and dirty test at this point.

[tt]
ScoreHeader
---------------------
TextBox
---------------------
Detail
---------------------
TextBox TextBox TextBox
---------------------
ScoreFooter
---------------------
TextBox
---------------------
[/tt]

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim dblCY As Double
    Dim dblPY As Double
    If Me.ScoreRange = Forms!frmmain.txtCurYr Then
        Me.Text90 = Me.Text5
        Me.Text90.Visible = False
    Else
        dblCY = Me.Text90
        dblPY = Me.Text5
    
        If dblCY - dblPY < 0 Then
            Me.Text90 = "Down"
        ElseIf dblCY - dblPY > 0 Then
            Me.Text90 = "Up"
        Else
            Me.Text90 = "On Par"
        End If
        Me.Text90.Visible = True
        dblCY = 0
        dblPY = 0
    End If
 
add another grouping for the individual score, you may need to create a new generated unique index or something...

then in this new grouping, on the headder, put the may-05 stuff and on the footer put the may-06 and in the details put a text box and have it centered...

If you want to use arrows, then you would need to have a bitmap image somewhere and have your code dynamically "paint" the up and down arrows on the controls on the format event...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top