Question

aroraaj

New member
Local time
Today, 15:08
Joined
Jan 19, 2009
Messages
8
I have a report in Access. In this report there aer different types of data and in one of the category the data has numbers. Is there a way in report for some numbers to show as percentage and some to show just as regular number? For example:

Category Data
Percent D 10%
Percent C 10%
Number of A 5
 
If you can identify what row should be percentage and what row should be number, you can format your output data that way. In the Detail section of your report, you can use the IF statement or SELECT CASE statement to determine that.

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

   select case me.Category
        case "P"
              me.txtValue = FormatPercent(me.the_field_contain_the_data,2
        case "N"
              me.txtValue = FormatNumber(me.the_field_contain_the_data,2)
        case else
              me.txtValue = me.the_field_contain_the_data
   end select

End Sub
 
I tried using that code and for Me.txtValue it says Method or data member not found.

I also tried textValue but same message. Any idea why its not taking that?
 

Users who are viewing this thread

Back
Top Bottom