A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional formatting of detail section in an access form



 
 
Thread Tools Display Modes
  #1  
Old January 21st, 2010, 12:05 PM posted to microsoft.public.access.forms
PBradac
external usenet poster
 
Posts: 3
Default Conditional formatting of detail section in an access form

I'm stuck in the following problem:

- Access 2003
- Form in datasheet view (tabular form)
- Want to format (change the background color of) details section
based on a value of a text box contained in it using VBA
- Can't find where to put a statement like:
Me.Section(acDetail).Backcolor = vbWhite
so that the background would be colored correspondingly.
The coloration appears only when the condition is met on the first
record (row) shown and it spreads over all records (rows)

I want to have the right color in those rows only where the condition
is met.

TIA for help
  #2  
Old January 21st, 2010, 01:39 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Conditional formatting of detail section in an access form

On Thu, 21 Jan 2010 13:05:19 +0100, PBradac
wrote:

Check out "Conditional Formatting" in the Help file.

-Tom.
Microsoft Access MVP


I'm stuck in the following problem:

- Access 2003
- Form in datasheet view (tabular form)
- Want to format (change the background color of) details section
based on a value of a text box contained in it using VBA
- Can't find where to put a statement like:
Me.Section(acDetail).Backcolor = vbWhite
so that the background would be colored correspondingly.
The coloration appears only when the condition is met on the first
record (row) shown and it spreads over all records (rows)

I want to have the right color in those rows only where the condition
is met.

TIA for help

  #3  
Old January 21st, 2010, 02:11 PM posted to microsoft.public.access.forms
PBradac
external usenet poster
 
Posts: 3
Default Conditional formatting of detail section in an access form

Hello Tom and thanks for your answer.

I've tried Help before but I couldn't find the answer.
In Help it's all about changing the formatting properties *of the
control based on its value*.

What I want is to change a formatting property of the whole details
section where the control is (based on the control's value of course).
E.g. if a text box shows a negative value I want the whole detail
section to show in red not just the text in the textbox.

It's simple to change the color of the details section in VBA, but
where do I have to put

Me.Section(acDetail).Backcolor = vbRed

so that it will be "executed" for the row where the textbox with
negative value is situated.

Primoz


On Thu, 21 Jan 2010 06:39:29 -0700, Tom van Stiphout
wrote:

On Thu, 21 Jan 2010 13:05:19 +0100, PBradac
wrote:

Check out "Conditional Formatting" in the Help file.

-Tom.
Microsoft Access MVP


I'm stuck in the following problem:

- Access 2003
- Form in datasheet view (tabular form)
- Want to format (change the background color of) details section
based on a value of a text box contained in it using VBA
- Can't find where to put a statement like:
Me.Section(acDetail).Backcolor = vbWhite
so that the background would be colored correspondingly.
The coloration appears only when the condition is met on the first
record (row) shown and it spreads over all records (rows)

I want to have the right color in those rows only where the condition
is met.

TIA for help


--- news://freenews.netfront.net/ - complaints: ---
  #4  
Old January 21st, 2010, 02:20 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Conditional formatting of detail section in an access form

On Thu, 21 Jan 2010 15:11:15 +0100, PBradac
wrote:

I see the dilemma now. You can set conditional formatting to controls,
not to the Details section itself. Perhaps that suffices though.

-Tom.
Microsoft Access MVP


Hello Tom and thanks for your answer.

I've tried Help before but I couldn't find the answer.
In Help it's all about changing the formatting properties *of the
control based on its value*.

What I want is to change a formatting property of the whole details
section where the control is (based on the control's value of course).
E.g. if a text box shows a negative value I want the whole detail
section to show in red not just the text in the textbox.

It's simple to change the color of the details section in VBA, but
where do I have to put

Me.Section(acDetail).Backcolor = vbRed

so that it will be "executed" for the row where the textbox with
negative value is situated.

Primoz


On Thu, 21 Jan 2010 06:39:29 -0700, Tom van Stiphout
wrote:

On Thu, 21 Jan 2010 13:05:19 +0100, PBradac
wrote:

Check out "Conditional Formatting" in the Help file.

-Tom.
Microsoft Access MVP


I'm stuck in the following problem:

- Access 2003
- Form in datasheet view (tabular form)
- Want to format (change the background color of) details section
based on a value of a text box contained in it using VBA
- Can't find where to put a statement like:
Me.Section(acDetail).Backcolor = vbWhite
so that the background would be colored correspondingly.
The coloration appears only when the condition is met on the first
record (row) shown and it spreads over all records (rows)

I want to have the right color in those rows only where the condition
is met.

TIA for help


--- news://freenews.netfront.net/ - complaints: ---

  #5  
Old January 21st, 2010, 02:32 PM posted to microsoft.public.access.forms
PBradac
external usenet poster
 
Posts: 3
Default Conditional formatting of detail section in an access form

Tom,

not very happy :-(, but thanks anyway :-).

I was wondering if moving the focus through the records (and by it
through rows in datasheet) could somehow help. I'll give it a try.

Regards,
Primoz


On Thu, 21 Jan 2010 07:20:35 -0700, Tom van Stiphout
wrote:

On Thu, 21 Jan 2010 15:11:15 +0100, PBradac
wrote:

I see the dilemma now. You can set conditional formatting to controls,
not to the Details section itself. Perhaps that suffices though.

-Tom.
Microsoft Access MVP


Hello Tom and thanks for your answer.

I've tried Help before but I couldn't find the answer.
In Help it's all about changing the formatting properties *of the
control based on its value*.

What I want is to change a formatting property of the whole details
section where the control is (based on the control's value of course).
E.g. if a text box shows a negative value I want the whole detail
section to show in red not just the text in the textbox.

It's simple to change the color of the details section in VBA, but
where do I have to put

Me.Section(acDetail).Backcolor = vbRed

so that it will be "executed" for the row where the textbox with
negative value is situated.

Primoz


On Thu, 21 Jan 2010 06:39:29 -0700, Tom van Stiphout
wrote:

On Thu, 21 Jan 2010 13:05:19 +0100, PBradac
wrote:

Check out "Conditional Formatting" in the Help file.

-Tom.
Microsoft Access MVP


I'm stuck in the following problem:

- Access 2003
- Form in datasheet view (tabular form)
- Want to format (change the background color of) details section
based on a value of a text box contained in it using VBA
- Can't find where to put a statement like:
Me.Section(acDetail).Backcolor = vbWhite
so that the background would be colored correspondingly.
The coloration appears only when the condition is met on the first
record (row) shown and it spreads over all records (rows)

I want to have the right color in those rows only where the condition
is met.

TIA for help


--- news://freenews.netfront.net/ - complaints: ---


---
news://freenews.netfront.net/ - complaints: ---
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.