H
hermie
Hello
On my report I have in the footer 4 fields. Field 1 and 2 are sum fields,
Field3 = field1/field2, Field 4 is a calfunction from a module.
When I calculate field 3 like: =round((field1/field2)*100) gives a value
like 68 and the calfunction of field4 generates a value of D
This is all good
Now I want to show the value as percent, when I change Field3 into
=field1/field2 with format percent it shows the correct value with % sign.
However Field4 generates a wrong value it shows an F instead of an D
Example:
value points Percent Nota
36 23 63.89 D
24 18 75.00 C
33 26 78.79 C
27 15 55.56 F
total 120 82 68 D
68% F
The code of the module is:
Public Function caltarea(Pertar As String) As String
Select Case CDbl(Pertar)
Case Is >= 90#
caltarea = "A"
Case Is >= 80# And Pertar < 90#
caltarea = "B"
Case Is >= 70# And Pertar < 80#
caltarea = "C"
Case Is >= 60# And Pertar < 70#
caltarea = "D"
Case Is < 60#
caltarea = "F"
Case Else
caltarea = "?"
End Select
End Function
I have tried to change field3 with Cdbl, Cstr but not work.
How can I show field3 as 68% and field 4 with D
How someone knows a solution
Herman
On my report I have in the footer 4 fields. Field 1 and 2 are sum fields,
Field3 = field1/field2, Field 4 is a calfunction from a module.
When I calculate field 3 like: =round((field1/field2)*100) gives a value
like 68 and the calfunction of field4 generates a value of D
This is all good
Now I want to show the value as percent, when I change Field3 into
=field1/field2 with format percent it shows the correct value with % sign.
However Field4 generates a wrong value it shows an F instead of an D
Example:
value points Percent Nota
36 23 63.89 D
24 18 75.00 C
33 26 78.79 C
27 15 55.56 F
total 120 82 68 D
68% F
The code of the module is:
Public Function caltarea(Pertar As String) As String
Select Case CDbl(Pertar)
Case Is >= 90#
caltarea = "A"
Case Is >= 80# And Pertar < 90#
caltarea = "B"
Case Is >= 70# And Pertar < 80#
caltarea = "C"
Case Is >= 60# And Pertar < 70#
caltarea = "D"
Case Is < 60#
caltarea = "F"
Case Else
caltarea = "?"
End Select
End Function
I have tried to change field3 with Cdbl, Cstr but not work.
How can I show field3 as 68% and field 4 with D
How someone knows a solution
Herman