Hi,

I am new to VB code. I can programme in flashscript. I should imagine this would be a fairly straight forward bit of code to produce?

I have read: http://www.techonthenet.com/access/forms/change_bg.php which explains how to change a background colour of a textbox if a fieldvalue is null. However, here is what I want to achieve:



(this is essentially to colour code progress or negative progress in two test results)

(testA score) fieldA (contains a number between 1 and 16)
(testB score) fieldB (contains a number between 1 and 16)

If fieldB value < fieldA value THEN fieldB background = red
If fieldB value = fieldA value THEN fieldB background = yellow
If fieldB value = (fieldA value + 1) THEN fieldB background = green
If fieldB value = (fieldA value + 2) THEN fieldB background = pink
If fieldB value = (fieldA value + 3) THEN fieldB background = purple

If you could let me know the correct VB code I would be very appreciative. I'm using Access 2002.

Many thanks!