"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:(E-Mail Removed)...
> On Sat, 24 Apr 2010 16:30:01 -0700, gngsquared
> <(E-Mail Removed)> wrote:
>>
>>Can I use the same list to change the BackColor of the field depending on
>>the selection? If I use Conditional Format to the field I am limited to 3
>>choices. I would need at least 4 or 5 colors to do it right. And it would
>>be
>>useful elsewhere.
>
> Sure. Just set the Backcolor property in the same code; each Case of a
> Select
> Case block can contain as many lines of code as you need:
>
> Private Sub DocID_AfterUpdate
> Select Case Me!DocID
> Case "this"
> Me!CompDate.Setfocus
> Me!CompDate.BackColor = vbRed
> Case "that"
> Me!SubDate.Setfocus
> Me!CompDate.BackColor = vbGreen
> Case "TheOther"
> <and so on>
> End Select
> End Sub
But be aware that on a continuous form, property changes made in code like
this -- as opposed to by conditional formatting -- will apply to every
record, not just the current one.
Conditional formatting's limitation of 3 conditions per object can be hard
to get around. This question came up recently in another thread, and I
posted this (rather cumbersome) workaround, which may possible be useful to
gngsquared:
http://groups.google.com/group/micro...762dfbf998e669
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)