Joined: 08 Dec 2010
Location: United States
Online Status: Offline
Posts: 8
Topic: Formula for Enable Currency Symbol Posted: 20 Dec 2010 at 8:10am
I am trying to create a formula that will decide whether or not to show a floating Currency Symbol in a field in my detail band.
The currency symbol should show depending on the value of a field in my group header. For instance, if the value of my field in the group header is blank, then the field in the detail band should show a $. Unless this field is not in the detail band where the row description is not a balance.
The 1st and 3rd rows should have the $ if the character field in the group header is blank. SourceName is the character field in the group header.
Here is my code:
if SourceName = "" then
select RowDescription
case "Beginning Balance" : crFloatingCurrencySymbol
case "Ending Balance" : crFloatingCurrencySymbol
default : crNoCurrencySymbol
else crNoCurrencySymbol
I have the currency symbol enabled and it is set to floating. I have this code placed in the formula box beside "Enable Currency Symbol". I've tried every combination of changing the defaults, but the field in the detail always shows the currency symbol for some reason, instead of only showing for the rows that it should. Could anyone let me know if my code looks correct?
Joined: 08 Dec 2010
Location: United States
Online Status: Offline
Posts: 8
Posted: 20 Dec 2010 at 9:17am
This code works when not factoring in the Group Header field to be blank.
select RowDescription
case "Beginning Balance" : crFloatingCurrencySymbol
case "Ending Balance" : crFloatingCurrencySymbol
default : crNoCurrencySymbol
This code will show the $ symbol if RowDescription is Beginning of Ending Balance and no symbol shows otherwise. However, when I include the other factor of the Group Header field being blank, it seems to just revert to what is set in the default settings.
Joined: 08 Dec 2010
Location: United States
Online Status: Offline
Posts: 8
Posted: 20 Dec 2010 at 9:18am
I'm sorry. It's a character field from a table just as Amount is a numeric field from the same table. The field in the group header, "SourceName", is also a character field.
Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Posted: 20 Dec 2010 at 9:21am
So then the question becomes...are they really "blank"?
It's possible that they're something else, like maybe a null char. I'm not too sure about how default values work, but that has gotten me a couple times when I assumed a field would be the empty string when it was in fact null..
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum