Conditional formatting works for combo box not for text box

G

Guest

I have a continous form, I have selected both combo box and text box and
turned on conditional formatting, which has changed the background colour for
only the combo boxes but not the text boxes.
 
F

fredg

I have a continous form, I have selected both combo box and text box and
turned on conditional formatting, which has changed the background colour for
only the combo boxes but not the text boxes.

You haven't stated what the conditions are.
Perhaps the condition is not met for the Text control.
 
G

Guest

The condition is an expression based on a date field in each record

DateDiff("m","QuoteCreationDate",Now())=0
 
F

fredg

The condition is an expression based on a date field in each record

DateDiff("m","QuoteCreationDate",Now())=0
QuoteCreationDate

You wish to conditionally format a Date Datatype control if it's value
is the same MONTH as the current month?
Select the Text Control.
Click on Conditonal Formatting.
Set Condition1 to Expression Is
Set the expression to:
Month([QuoteCreationDate]) = Month(Date())
 
G

Guest

Fred,

Thanks very much for your help ...

Can you help me understand why your expression worked and mine didn't work
for text boxes.

fredg said:
The condition is an expression based on a date field in each record

DateDiff("m","QuoteCreationDate",Now())=0
QuoteCreationDate

You wish to conditionally format a Date Datatype control if it's value
is the same MONTH as the current month?
Select the Text Control.
Click on Conditonal Formatting.
Set Condition1 to Expression Is
Set the expression to:
Month([QuoteCreationDate]) = Month(Date())
 
F

fredg

Fred,

Thanks very much for your help ...

Can you help me understand why your expression worked and mine didn't work
for text boxes.

fredg said:
The condition is an expression based on a date field in each record

DateDiff("m","QuoteCreationDate",Now())=0
QuoteCreationDate
:

On Tue, 30 May 2006 23:09:02 -0700, Peter wrote:

I have a continous form, I have selected both combo box and text box and
turned on conditional formatting, which has changed the background colour for
only the combo boxes but not the text boxes.

You haven't stated what the conditions are.
Perhaps the condition is not met for the Text control.

You wish to conditionally format a Date Datatype control if it's value
is the same MONTH as the current month?
Select the Text Control.
Click on Conditonal Formatting.
Set Condition1 to Expression Is
Set the expression to:
Month([QuoteCreationDate]) = Month(Date())

Your expression was
DateDiff("m","QuoteCreationDate",Now())

Because you enclosed QuoteCreationDate within quotes instead of
brackets, Access will treat it as a String, not as a date field.
Your use of Now(), while not causing a problem here, is overkill.
Now() includes a Time value as well as a Date value. Unless the Time
of day is necessary (which if you are looking for the Month it is
not), I feel it's a good habit to use Date().

DateDiff("m",[QuoteCreationDate],Now()) should work.
DateDiff("m",[QuoteCreationDate],Date()) should work.
Month([QuoteCreationDate])= Month(Date()) is more direct.
 

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