Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Conditional Formatting

Geek News

Conditional Formatting
Mary Fetsch 11/13/2008 9:48:10 PM
In Access 2003, I had this code to apply conditional formatting to a field:

With GrownYrSeason.FormatConditions _
.Add(acExpression, acNotEqual, Nz(GrownYrYear.Value, "") <> "XXX")
.BackColor = RGB(230, 230, 230)
End With

I recently upgraded to Access 2007, and this code seems to work sometimes,
and other times I get this message:

Run-time error '7966':

The format condition number you specified is greater than the number
of format conditions.

I've tried this all different ways with no luck. Any ideas?

Mary Fetsch




Re: Conditional Formatting
"Damon Heron" <damon_327[ at ]hotmail.com> 11/14/2008 6:10:03 PM
If you use acExpression, acNotEqual is ignored. Try removing it and see
what happens.

Damon

"Mary Fetsch" <MaryFetsch[ at ]discussions.microsoft.com> wrote in message
news:9FEA4E78-91D5-4FC2-875E-74017ED8F88D[ at ]microsoft.com...
[Quoted Text]
> In Access 2003, I had this code to apply conditional formatting to a
> field:
>
> With GrownYrSeason.FormatConditions _
> .Add(acExpression, acNotEqual, Nz(GrownYrYear.Value, "") <>
> "XXX")
> .BackColor = RGB(230, 230, 230)
> End With
>
> I recently upgraded to Access 2007, and this code seems to work sometimes,
> and other times I get this message:
>
> Run-time error '7966':
>
> The format condition number you specified is greater than the number
> of format conditions.
>
> I've tried this all different ways with no luck. Any ideas?
>
> Mary Fetsch
>
>
>
>


Re: Conditional Formatting
Mary Fetsch 11/14/2008 6:20:04 PM
Are you sure? I entered

GrownYrSeason.FormatConditions.Delete

above the code I sent you, and now my code is working.

Thanks for your response!

"Damon Heron" wrote:

[Quoted Text]
> If you use acExpression, acNotEqual is ignored. Try removing it and see
> what happens.
>
> Damon
>
> "Mary Fetsch" <MaryFetsch[ at ]discussions.microsoft.com> wrote in message
> news:9FEA4E78-91D5-4FC2-875E-74017ED8F88D[ at ]microsoft.com...
> > In Access 2003, I had this code to apply conditional formatting to a
> > field:
> >
> > With GrownYrSeason.FormatConditions _
> > .Add(acExpression, acNotEqual, Nz(GrownYrYear.Value, "") <>
> > "XXX")
> > .BackColor = RGB(230, 230, 230)
> > End With
> >
> > I recently upgraded to Access 2007, and this code seems to work sometimes,
> > and other times I get this message:
> >
> > Run-time error '7966':
> >
> > The format condition number you specified is greater than the number
> > of format conditions.
> >
> > I've tried this all different ways with no luck. Any ideas?
> >
> > Mary Fetsch
> >
> >
> >
> >
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net