That can be a bit tricky if you are new to CR. In your code, make sure you are not resetting it in the formula that is in the Details section. If you need to reset the formula, do it in a group header section or page header. Also, your code should not be an If-Then-Else where the Else part resets it. You only do the part that sets it. Here is an example:
BooleanVar ShowFlag;
If {field}= "something" Then
ShowFlag := True;
That way, once the variable is set to true, it won't get reset back to false on the next record.
If a record from another Detail section is resetting it for some reason, then either don't put the formula in that section or add another condition to skip the test if you are on a record that doesn't apply.
BooleanVar ShowFlag;
If {recordtype} = "a" Then
If {field}="something" Then
ShowFlag:=True;
Since you are new to CR, you should check out chapters 5-7 in my book
Crystal Reports Encyclopedia. It will make you an expert on formulas.
Edited by BrianBischof - 08 Dec 2007 at 12:31pm