formatting for more than 4 conditions

  • Thread starter Thread starter papa jonah
  • Start date Start date
P

papa jonah

I am using a form that has a text box that indicates a value from a
table. I want it to change the back color dependent on the value.
Using the Conidtional Formatting funciont (right click) this is easy
enough for 4 conditions. However, I need to enter more. With Excel, I
would do this in VB. I assume I would do this here as well. However,
I am not sure how to write the code, or what event to put it into.
Would I put this in the after update event for the text box (should I
enter a value (which is not required)? What about for the form as a
whole so that it updates as I scroll from record to record?

TIA
 
Hi
You need to use the 'on current' event of the Form and put in vb code
similar to this:
If txtName Between 1 And 40 Then
txtName.BackColor = xxxxxxx
ElseIf blah blah

You should then add the following code in the 'After Update' event of the
text box:
Call Form_Current

Hope this helps
Lee
 
Back
Top