PC Review


Reply
Thread Tools Rate Thread

FormatConditions Entire Row

 
 
Phil
Guest
Posts: n/a
 
      15th Oct 2003
Does anyone know how to tchange the color of all fields
in on row of a form?

Using the code below in the CurrentRecord of the form, I
can get a single field's Unique value to turn yellow, but
I also need the entrie row to turn yellow. The fields in
the rest on the row may not be Unique.

Private Sub Form_Current()

Dim fcd As FormatCondition

With Form_frmTransactions_SGH.CCN
With .FormatConditions
.Delete
Set fcd = .Add(acFieldValue, acEqual, "'" &
Form_frmTransactions_SGH.CCN & "'")
fcd.BackColor = vbYellow
End With
End With

End Sub

Thanks, phil


 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      16th Oct 2003
Phil wrote:

>Does anyone know how to tchange the color of all fields
>in on row of a form?
>
>Using the code below in the CurrentRecord of the form, I
>can get a single field's Unique value to turn yellow, but
>I also need the entrie row to turn yellow. The fields in
>the rest on the row may not be Unique.
>
>Private Sub Form_Current()
>
> Dim fcd As FormatCondition
>
> With Form_frmTransactions_SGH.CCN
> With .FormatConditions
> .Delete
> Set fcd = .Add(acFieldValue, acEqual, "'" &
>Form_frmTransactions_SGH.CCN & "'")
> fcd.BackColor = vbYellow
> End With
> End With
>
>End Sub


Sorry but I don't recognize what you're doing there. It
sort of looks like you're manipulating the format conditions
of a control, but I can't figure out why. Maybe you just
got started down a twisty path? or maybe I don't understand
what you're trying to do.

To make the entire detail section of a form display a
conditional background color, first make all of the
section's controls BackStyle Transparent. Then add a
rectangle control the same height and width as the entire
section, use the Formst Send to Back menu item to place it
behind all the other controls. Now you can use Conditional
Formatting on the one rectangle control to control the color
of the entire section.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
 
 
 
Stephen Lebans
Guest
Posts: n/a
 
      16th Oct 2003
Also it kinds of defeats the purpose of CF to modify it on every Current
event.

Marshall due to a bug in CF you have to setup the FormatConditions
object programmatically in order to ensure that the background TextBox
control's Enabled property setting will be respected. Sample code here:
http://www.lebans.com/conditionalformatting.htm

Just my $.02

--
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Marshall Barton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Phil wrote:
>
> >Does anyone know how to tchange the color of all fields
> >in on row of a form?
> >
> >Using the code below in the CurrentRecord of the form, I
> >can get a single field's Unique value to turn yellow, but
> >I also need the entrie row to turn yellow. The fields in
> >the rest on the row may not be Unique.
> >
> >Private Sub Form_Current()
> >
> > Dim fcd As FormatCondition
> >
> > With Form_frmTransactions_SGH.CCN
> > With .FormatConditions
> > .Delete
> > Set fcd = .Add(acFieldValue, acEqual, "'" &
> >Form_frmTransactions_SGH.CCN & "'")
> > fcd.BackColor = vbYellow
> > End With
> > End With
> >
> >End Sub

>
> Sorry but I don't recognize what you're doing there. It
> sort of looks like you're manipulating the format conditions
> of a control, but I can't figure out why. Maybe you just
> got started down a twisty path? or maybe I don't understand
> what you're trying to do.
>
> To make the entire detail section of a form display a
> conditional background color, first make all of the
> section's controls BackStyle Transparent. Then add a
> rectangle control the same height and width as the entire
> section, use the Formst Send to Back menu item to place it
> behind all the other controls. Now you can use Conditional
> Formatting on the one rectangle control to control the color
> of the entire section.
>
> --
> Marsh
> MVP [MS Access]


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone ever seen a case where FormatConditions.Count = -1 ? roybrew@att.net Microsoft Excel Discussion 2 6th Jan 2005 03:12 PM
FormatConditions (fails in different Languages) DamiaoBR Microsoft Excel Programming 0 12th May 2004 01:54 AM
Excel VBA - FormatConditions problem Byrt Martinez Microsoft Excel Programming 1 27th Jan 2004 02:46 AM
FormatConditions - more than 3 workaround? Vektor Microsoft Access Forms 2 28th Nov 2003 11:30 PM
Re: font size on formatconditions Chip Pearson Microsoft Excel Programming 0 13th Aug 2003 02:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:42 AM.