Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Unanswered: Horizontal bar in txtBar field as a percent

    This is the calculation I have based on a report field in the detail section of a report. =Report!count. This provides a number. Format standard.

    The highest number is usually around 1,500 but mostly in the 100-300 range.

    I also have an unbound text box named txtBar in the detail records.

    I'm looking for a graphic percent bar to expand in the txtBar text box in the detail records. The txtBar is formatted as percent.

    This also works for the percent number: =report!count/100 but I haven't been able to convert this into a horizontal expandable bar in the txtBar field.

    Also, what happens if the number is over 100 (100%)? how do I make that work?

    I'm sorry I can't explain this well.

    Thanks.

    Rick

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so adjust the width of the bar to the percentage value in the reports on format event
    what woudl you expect to do if the percentage was more than 100%
    its your report
    its trying to encapsulaste the meaning you ascribe to that value.

    hint if you set it in the on format you can do whatever the heck you like, simialr to conditional formatting except you have whatever control you like, you cna set what ever colours you like

    eg, say 50% and below colour red, 50..75 colour dark red, 75..85 amber/yellow, 85 to 100 green and so on. you are limited by the information you wish to portray

    theres a post I made relatively recently including a zip called holiday chart.. have a look at it it may give you some ideas
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    I think this is to be attached to the DETAIL section

    This is what I have . . .
    Code:
    Private Sub Detail_1Format(Cancel As Integer, FormatCount As Integer)
    If Report!Count < 50 Then
     
    txtBAR.BackColor = 255
     
    Else
     
    txtBAR.BackColor = 0
     
    End If
    
    End Sub
    This does not show up in the control Source of the properties tab.

    I get no errors but no results either?

    Thanks . . . Rick

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what is detail1_format, I'd expect detail1_format

    for now Id suggest you use colours other than white eg backcolour = vbred else backcolour =vbblue

    have you checked you have some rows which will have a count of >0

    to adjust the width you need to know your reference level Ie what will be 100%. if you allow for more than 100% you have to decide how much extra width to allow (or calculate what the maximum value is as part of the reports on activate event.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •