The Dog Posted May 21, 2006 Posted May 21, 2006 Hi All. First of all I want to say thanks for the help I have recived from this site... Next I have yet another problem ;o) I want to make the color of the text in a field depend on the content of the field. Something like this: if xx=0 set color to red else set color to black Looked at the different script functions but have not found any that I think/know could do the job.... Any help would be great Best regards The Dog
mz123 Posted May 21, 2006 Posted May 21, 2006 You can create your field to be an auto-calc with replace (keep it as a text field, and double-click on the field definition and check auto-calculation, make sure "with replace": Case( field1 = 0; TextColor(field1; RGB(255;0;0)); field1 = 1; TextColor(field1; RGB(0;255;0)); TextColor(field1; RGB(0;0;0)) I hope that helps!
LaRetta Posted May 21, 2006 Posted May 21, 2006 Nice ... but The Dog is vs. 6, Martha. I see no indication that they want this for vs. 7/8. UPDATE: You can use a regular calculation and stack it on top of your standard field. Regular calculation would be formatted in your color (from field format level). Then calculation would be something like: Case ( xx=0 ; theField ) In this way, it would show if the condition were true and no show if it wasn't true. Set the calc to not allow entry into field and make the border and fill transparent. Use Arrange to stack them precisely and make sure calc is on top (use Arrange > Bring to Front). When properly stacked, the calc will display on top of (appearing in place of) the standard field.
mz123 Posted May 21, 2006 Posted May 21, 2006 Woops I should have caught that. Thanks for pointing it out LaRetta!
LaRetta Posted May 22, 2006 Posted May 22, 2006 No worry ... I've done it also. BTW, it's been awhile since I've used vs. 6 and the above isn't tested. But I'm pretty confident that's what I used to use.
Recommended Posts
This topic is 7097 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now