Colouring continuous forms

  • Thread starter Rohan via AccessMonster.com
  • Start date
R

Rohan via AccessMonster.com

I have a window with a continuous form in it, to create a ledger.

I want to make one of the fields blue, if another field is 0, but only on
that line in the ledger.

I tried using field.forecolor on an if statement in the onCurrent event, but
that colours in the whole
column when you go to that line.

Any clues ?

Rohan.
 
S

strive4peace

Conditional Formatting
---


Hi Rohan,

use Conditional Formatting

choose the control that you want to change color

from the menu: Format, Conditional Formatting...

Expression Is --> [OtherFieldname] = 0 --> set format to Blue


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
R

Rohan via AccessMonster.com

use Conditional Formatting

Thanks for your help - works like a treat.

Rohan.
 
S

strive4peace

you're welcome, Rohan ;) happy to help

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

Guest

Hi strive4peace

I have found your answer to this problem interesting, I too have been trying
to change the colour of one field based on a value in another field within
the same record and found that all the records in the form applied the
change, I am using Access 97, how can I use you fix to help me with this, I
have looked for conditional format on the target field but cannot find where
to apply your fix.

I would be grateful for your help if you can do.


Thank you in advance


Joe

strive4peace said:
Conditional Formatting
---


Hi Rohan,

use Conditional Formatting

choose the control that you want to change color

from the menu: Format, Conditional Formatting...

Expression Is --> [OtherFieldname] = 0 --> set format to Blue


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


I have a window with a continuous form in it, to create a ledger.

I want to make one of the fields blue, if another field is 0, but only on
that line in the ledger.

I tried using field.forecolor on an if statement in the onCurrent event, but
that colours in the whole
column when you go to that line.

Any clues ?

Rohan.
 
S

strive4peace

Hi Joe,

Access 97 does not have Conditional Formatting

is your form continuous or single form view? If continuous, there is
nothing I am aware of as all records will change...

the only thing I know of to change colors of control in Access97 is
using the different parts of the Format property, but those are limited
to evaluating the control itself for positive, negative, null, or zero...

on format code for numbers -- there are 4 parts
1. format for positive numbers
2. format for negative numbers
3. format for 0 (zero)
4. format for null

ie:

Format --> #,##0;[red]-#,##0;0;0
numbers will have no decimal places
negative numbers will be Red
zeros and null values will show up as a 0

Format --> #,###.##;[red]-#,###.##;"";""
numbers will show up to 2 decimal places
negative numbers will be Red
zeros and null values will not be displayed

for more help on Format, press the F1 key in the Format property on the
property sheet


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe said:
Hi strive4peace

I have found your answer to this problem interesting, I too have been trying
to change the colour of one field based on a value in another field within
the same record and found that all the records in the form applied the
change, I am using Access 97, how can I use you fix to help me with this, I
have looked for conditional format on the target field but cannot find where
to apply your fix.

I would be grateful for your help if you can do.


Thank you in advance


Joe

strive4peace said:
Conditional Formatting
---


Hi Rohan,

use Conditional Formatting

choose the control that you want to change color

from the menu: Format, Conditional Formatting...

Expression Is --> [OtherFieldname] = 0 --> set format to Blue


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


I have a window with a continuous form in it, to create a ledger.

I want to make one of the fields blue, if another field is 0, but only on
that line in the ledger.

I tried using field.forecolor on an if statement in the onCurrent event, but
that colours in the whole
column when you go to that line.

Any clues ?

Rohan.
 
G

Guest

Hi Crystal,

Thanks for your prompt reply, I have used the method you suggest, on this
ccasion however the data is not numeric, but text

I am using the following code on the Continuous form's On Current Event :-
Both Fields being Text

This will change the colour of Field2 as I want, but again the whole column
will also change colour.

If Me.Field1 = "A" Then
Field2.ForeColor = 13209
End If

I have also tried placing a third Field with ForeColor set to red and
Visible = False which I placed on top of Field2 and used the following :-: -

If Me.Field1 = "A" Then
Field3.Visible = True
End If

This resulted with the same problem

Anyway, many thanks again and you too have an awesome day

Joe


strive4peace said:
Hi Joe,

Access 97 does not have Conditional Formatting

is your form continuous or single form view? If continuous, there is
nothing I am aware of as all records will change...

the only thing I know of to change colors of control in Access97 is
using the different parts of the Format property, but those are limited
to evaluating the control itself for positive, negative, null, or zero...

on format code for numbers -- there are 4 parts
1. format for positive numbers
2. format for negative numbers
3. format for 0 (zero)
4. format for null

ie:

Format --> #,##0;[red]-#,##0;0;0
numbers will have no decimal places
negative numbers will be Red
zeros and null values will show up as a 0

Format --> #,###.##;[red]-#,###.##;"";""
numbers will show up to 2 decimal places
negative numbers will be Red
zeros and null values will not be displayed

for more help on Format, press the F1 key in the Format property on the
property sheet


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe said:
Hi strive4peace

I have found your answer to this problem interesting, I too have been trying
to change the colour of one field based on a value in another field within
the same record and found that all the records in the form applied the
change, I am using Access 97, how can I use you fix to help me with this, I
have looked for conditional format on the target field but cannot find where
to apply your fix.

I would be grateful for your help if you can do.


Thank you in advance


Joe

strive4peace said:
Conditional Formatting
---


Hi Rohan,

use Conditional Formatting

choose the control that you want to change color

from the menu: Format, Conditional Formatting...

Expression Is --> [OtherFieldname] = 0 --> set format to Blue


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Rohan via AccessMonster.com wrote:
I have a window with a continuous form in it, to create a ledger.

I want to make one of the fields blue, if another field is 0, but only on
that line in the ledger.

I tried using field.forecolor on an if statement in the onCurrent event, but
that colours in the whole
column when you go to that line.

Any clues ?

Rohan.
 
S

strive4peace

you're welcome, Joe

In Access 97, there is a way to simulate what the conditional formatting
does...

in the underlying recordset:

GreenField: IIF(condition_for_green, [fieldname],"")
BlueField: IIF(condition_for_blue, [fieldname],"")
RedField: IIF(condition_for_red, [fieldname],"")

make 3 controls on your form -- each with transparent background and
with a different forecolor -- stack them on top of each other

obviously, these would be display only -- the user would have to use a
different control to enter data, or you could use the double-click event
to pop up an InputBox, assign value to fieldname, then save and refresh
the form

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe said:
Hi Crystal,

Thanks for your prompt reply, I have used the method you suggest, on this
ccasion however the data is not numeric, but text

I am using the following code on the Continuous form's On Current Event :-
Both Fields being Text

This will change the colour of Field2 as I want, but again the whole column
will also change colour.

If Me.Field1 = "A" Then
Field2.ForeColor = 13209
End If

I have also tried placing a third Field with ForeColor set to red and
Visible = False which I placed on top of Field2 and used the following :-: -

If Me.Field1 = "A" Then
Field3.Visible = True
End If

This resulted with the same problem

Anyway, many thanks again and you too have an awesome day

Joe


strive4peace said:
Hi Joe,

Access 97 does not have Conditional Formatting

is your form continuous or single form view? If continuous, there is
nothing I am aware of as all records will change...

the only thing I know of to change colors of control in Access97 is
using the different parts of the Format property, but those are limited
to evaluating the control itself for positive, negative, null, or zero...

on format code for numbers -- there are 4 parts
1. format for positive numbers
2. format for negative numbers
3. format for 0 (zero)
4. format for null

ie:

Format --> #,##0;[red]-#,##0;0;0
numbers will have no decimal places
negative numbers will be Red
zeros and null values will show up as a 0

Format --> #,###.##;[red]-#,###.##;"";""
numbers will show up to 2 decimal places
negative numbers will be Red
zeros and null values will not be displayed

for more help on Format, press the F1 key in the Format property on the
property sheet


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe said:
Hi strive4peace

I have found your answer to this problem interesting, I too have been trying
to change the colour of one field based on a value in another field within
the same record and found that all the records in the form applied the
change, I am using Access 97, how can I use you fix to help me with this, I
have looked for conditional format on the target field but cannot find where
to apply your fix.

I would be grateful for your help if you can do.


Thank you in advance


Joe

:

Conditional Formatting
---


Hi Rohan,

use Conditional Formatting

choose the control that you want to change color

from the menu: Format, Conditional Formatting...

Expression Is --> [OtherFieldname] = 0 --> set format to Blue


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Rohan via AccessMonster.com wrote:
I have a window with a continuous form in it, to create a ledger.

I want to make one of the fields blue, if another field is 0, but only on
that line in the ledger.

I tried using field.forecolor on an if statement in the onCurrent event, but
that colours in the whole
column when you go to that line.

Any clues ?

Rohan.
 
S

Stefan Hoffmann

hi Joe,

Joe said:
I am using Access 97, how can I use you fix to help me with this, I
have looked for conditional format on the target field but cannot find where
to apply your fix.
Take a look at lebans.com


mfG
--> stefan <--
 
G

Guest

Thanks Stefan

Had a quick look through lebans, there is plenty there of interest, I am
sure something there will help.
 
G

Guest

Thanks Crystal

I will give your solution a go and see how its goes, I will get back to let
you know if I have been successful or not (I usually make typos too, lol)

Joe

strive4peace said:
you're welcome, Joe

In Access 97, there is a way to simulate what the conditional formatting
does...

in the underlying recordset:

GreenField: IIF(condition_for_green, [fieldname],"")
BlueField: IIF(condition_for_blue, [fieldname],"")
RedField: IIF(condition_for_red, [fieldname],"")

make 3 controls on your form -- each with transparent background and
with a different forecolor -- stack them on top of each other

obviously, these would be display only -- the user would have to use a
different control to enter data, or you could use the double-click event
to pop up an InputBox, assign value to fieldname, then save and refresh
the form

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe said:
Hi Crystal,

Thanks for your prompt reply, I have used the method you suggest, on this
ccasion however the data is not numeric, but text

I am using the following code on the Continuous form's On Current Event :-
Both Fields being Text

This will change the colour of Field2 as I want, but again the whole column
will also change colour.

If Me.Field1 = "A" Then
Field2.ForeColor = 13209
End If

I have also tried placing a third Field with ForeColor set to red and
Visible = False which I placed on top of Field2 and used the following :-: -

If Me.Field1 = "A" Then
Field3.Visible = True
End If

This resulted with the same problem

Anyway, many thanks again and you too have an awesome day

Joe


strive4peace said:
Hi Joe,

Access 97 does not have Conditional Formatting

is your form continuous or single form view? If continuous, there is
nothing I am aware of as all records will change...

the only thing I know of to change colors of control in Access97 is
using the different parts of the Format property, but those are limited
to evaluating the control itself for positive, negative, null, or zero...

on format code for numbers -- there are 4 parts
1. format for positive numbers
2. format for negative numbers
3. format for 0 (zero)
4. format for null

ie:

Format --> #,##0;[red]-#,##0;0;0
numbers will have no decimal places
negative numbers will be Red
zeros and null values will show up as a 0

Format --> #,###.##;[red]-#,###.##;"";""
numbers will show up to 2 decimal places
negative numbers will be Red
zeros and null values will not be displayed

for more help on Format, press the F1 key in the Format property on the
property sheet


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe Coulter wrote:
Hi strive4peace

I have found your answer to this problem interesting, I too have been trying
to change the colour of one field based on a value in another field within
the same record and found that all the records in the form applied the
change, I am using Access 97, how can I use you fix to help me with this, I
have looked for conditional format on the target field but cannot find where
to apply your fix.

I would be grateful for your help if you can do.


Thank you in advance


Joe

:

Conditional Formatting
---


Hi Rohan,

use Conditional Formatting

choose the control that you want to change color

from the menu: Format, Conditional Formatting...

Expression Is --> [OtherFieldname] = 0 --> set format to Blue


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Rohan via AccessMonster.com wrote:
I have a window with a continuous form in it, to create a ledger.

I want to make one of the fields blue, if another field is 0, but only on
that line in the ledger.

I tried using field.forecolor on an if statement in the onCurrent event, but
that colours in the whole
column when you go to that line.

Any clues ?

Rohan.
 
S

strive4peace

you're welcome, Joe ;) hope it works for you

when you stach controls, you may need to select them using the Object
drop-down on the toolbar

use the Property sheet to set the
Width
Height
Top
Left

properties so you can get them all the same ;)


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe said:
Thanks Crystal

I will give your solution a go and see how its goes, I will get back to let
you know if I have been successful or not (I usually make typos too, lol)

Joe

strive4peace said:
you're welcome, Joe

In Access 97, there is a way to simulate what the conditional formatting
does...

in the underlying recordset:

GreenField: IIF(condition_for_green, [fieldname],"")
BlueField: IIF(condition_for_blue, [fieldname],"")
RedField: IIF(condition_for_red, [fieldname],"")

make 3 controls on your form -- each with transparent background and
with a different forecolor -- stack them on top of each other

obviously, these would be display only -- the user would have to use a
different control to enter data, or you could use the double-click event
to pop up an InputBox, assign value to fieldname, then save and refresh
the form

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe said:
Hi Crystal,

Thanks for your prompt reply, I have used the method you suggest, on this
ccasion however the data is not numeric, but text

I am using the following code on the Continuous form's On Current Event :-
Both Fields being Text

This will change the colour of Field2 as I want, but again the whole column
will also change colour.

If Me.Field1 = "A" Then
Field2.ForeColor = 13209
End If

I have also tried placing a third Field with ForeColor set to red and
Visible = False which I placed on top of Field2 and used the following :-: -

If Me.Field1 = "A" Then
Field3.Visible = True
End If

This resulted with the same problem

Anyway, many thanks again and you too have an awesome day

Joe


:

Hi Joe,

Access 97 does not have Conditional Formatting

is your form continuous or single form view? If continuous, there is
nothing I am aware of as all records will change...

the only thing I know of to change colors of control in Access97 is
using the different parts of the Format property, but those are limited
to evaluating the control itself for positive, negative, null, or zero...

on format code for numbers -- there are 4 parts
1. format for positive numbers
2. format for negative numbers
3. format for 0 (zero)
4. format for null

ie:

Format --> #,##0;[red]-#,##0;0;0
numbers will have no decimal places
negative numbers will be Red
zeros and null values will show up as a 0

Format --> #,###.##;[red]-#,###.##;"";""
numbers will show up to 2 decimal places
negative numbers will be Red
zeros and null values will not be displayed

for more help on Format, press the F1 key in the Format property on the
property sheet


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Joe Coulter wrote:
Hi strive4peace

I have found your answer to this problem interesting, I too have been trying
to change the colour of one field based on a value in another field within
the same record and found that all the records in the form applied the
change, I am using Access 97, how can I use you fix to help me with this, I
have looked for conditional format on the target field but cannot find where
to apply your fix.

I would be grateful for your help if you can do.


Thank you in advance


Joe

:

Conditional Formatting
---


Hi Rohan,

use Conditional Formatting

choose the control that you want to change color

from the menu: Format, Conditional Formatting...

Expression Is --> [OtherFieldname] = 0 --> set format to Blue


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Rohan via AccessMonster.com wrote:
I have a window with a continuous form in it, to create a ledger.

I want to make one of the fields blue, if another field is 0, but only on
that line in the ledger.

I tried using field.forecolor on an if statement in the onCurrent event, but
that colours in the whole
column when you go to that line.

Any clues ?

Rohan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top