RET Posted July 28, 2002 Posted July 28, 2002 Is it at all possible to create a script that will change background color based on a calculation? example: if the number goes under 100 it will be in green and if it goes above it will change to Red. If so how? Thansk, RET
LiveOak Posted July 28, 2002 Posted July 28, 2002 Not exactly, but you get the same effect. What you do is make your field transparent and place a calculated container field behind it. I usually create a repeating global container field to store the colored backgrounds. To get the background colors, draw colored rectangles in layout mode (same color borders and fills), copy one, enter browse mode, click in a repeat of the container field and paste. gColoredBkgds (global, container, repeating) Then create a calculated container field: cBackground (calculation, container) = Case( **Test for first color here***, GetRepetition(gColoredBkgds, 1), **Test for second color here**, GetRepetition(gColoredBkgds, 2), . . . "") In layout mode, select cBackground, Format menu --> graphic, select "reduce or enlarge" and uncheck "maintain proportions", and finally size cBackground to be the same size as your calculation field and place it behind it. It's much harder to describe than to actually do! -bd
mdpres Posted July 29, 2002 Posted July 29, 2002 As bd said its easier to do than explain, the way I did a balance due field that changes colors is created two new fields one field Bal due black text and one field is Bal due red text I made them both calc fields - Case(ACC REC PAID DATE > 1/1/98 and BAL DUE < 0,BAL DUE) this calc is for black text - Case(ACC REC PAID DATE = "" and BAL DUE > 0,BAL DUE,ACC REC PAID DATE2 > 0,BAL DUE) this calc is for red. I used my account paid date 1 & 2 as a check for balance dues then I made my calc fields transparent and layed over my Bal due Field so when a customer has paid an invoice the Bal due field turns black if there is a balance the field is red. Hope this helps. Dean
RET Posted July 29, 2002 Author Posted July 29, 2002 Thank you much, your instructions worked great. Also thank you for being so detiled, normally I would have never figured it out. RET
mborgens Posted July 30, 2002 Posted July 30, 2002 I like this process a lot. I'm using it more and more. Taking this one step further; you can make entire layouts change color or graphic based on calculation by placing the color/graphic field the layout. mb
LiveOak Posted July 30, 2002 Posted July 30, 2002 I like it! We could ask the user their mood on login and select a appropriate background or pick a pleasing backgound and random from a set. It would make those business databases less boring! -bd
danjacoby Posted July 30, 2002 Posted July 30, 2002 Yes, and being as they are, businesses, most of them will hate it. Their loss.
Recommended Posts
This topic is 8156 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