G
Guest
Hi all,
I have a problem that needs help. I have a report that needs to show
some discounts but these discount are not always contain a value. So, they
are concatenated using the formula like this:
…… IIf([discount2]>0,Str([discount2]) & "% ","") &
IIf([discount3]>0,Str([discount3]) & "% ","")……
However, user found that if the discount starts with "0" such as 0.25%,
the print out will be ".25%" with the starting 0 missed.
So, I have written a function in the module. It accepts a currency
variable, converts the input to string and check if the first 2 character are
" .". If so, add a "0" in front of it.
When I run the report again. I found it run very very slow.
Consequently, I want to ask if there are any alternatives instead of
writting a function to do this?
If a function is really required, how can I speed up the report printing?
The module written by me is as follows:
Function CurrencyToString(inCurrency As Currency) As String
CurrencyToString = Str(inCurrency)
If Left(CurrencyToString, 2) = " ." Then
CurrencyToString = " 0" & LTrim(CurrencyToString)
End If
End Function
Thanks for your attention.
Rgs,
John
I have a problem that needs help. I have a report that needs to show
some discounts but these discount are not always contain a value. So, they
are concatenated using the formula like this:
…… IIf([discount2]>0,Str([discount2]) & "% ","") &
IIf([discount3]>0,Str([discount3]) & "% ","")……
However, user found that if the discount starts with "0" such as 0.25%,
the print out will be ".25%" with the starting 0 missed.
So, I have written a function in the module. It accepts a currency
variable, converts the input to string and check if the first 2 character are
" .". If so, add a "0" in front of it.
When I run the report again. I found it run very very slow.
Consequently, I want to ask if there are any alternatives instead of
writting a function to do this?
If a function is really required, how can I speed up the report printing?
The module written by me is as follows:
Function CurrencyToString(inCurrency As Currency) As String
CurrencyToString = Str(inCurrency)
If Left(CurrencyToString, 2) = " ." Then
CurrencyToString = " 0" & LTrim(CurrencyToString)
End If
End Function
Thanks for your attention.
Rgs,
John