How do I hightlight field when criteria met?

S

Sklyn

Hi and thanks for taking the time to help.
I'm using Access 2003.
I have a field on a form which I want to highlight grey when another field
has a specific data entered.
Both fields are in the same table and on the same form.
The field "PurchaseOrLeaseType" is a combo box taking its list from another
table.
When this field has the data "Purchase" or "Gift" entered I would like the
text box "MnthlyPaymentincStamp" to turn Grey.
Is this possible??

Thanks again.
 
P

Patrick

If Purchase or Gift are fixed values you might consider using "conditional
format" for the textbox.
 
S

Sklyn

Thanks for ur reply Patrick,
Yes they are fixed values, but they need to be the value of a different box.
I need the "MnthlyPaymentincStamp" box to turn grey when 'Purchase' is
entered into the "PurchaseOrLeaseType" box.

So would I use an expression in the conditional format?
What would that be?

Forgive me please, I'm still learning access.
 
F

fredg

Thanks for ur reply Patrick,
Yes they are fixed values, but they need to be the value of a different box.
I need the "MnthlyPaymentincStamp" box to turn grey when 'Purchase' is
entered into the "PurchaseOrLeaseType" box.

So would I use an expression in the conditional format?
What would that be?

Forgive me please, I'm still learning access.

In Form Design View, select the [MnthlyPaymentincStamp] control.
Then click on View + Conditional Formatting
As Condition1 select
Expression Is
In the next dialog box write:
[PurchaseOrLeaseType] = "Purchase" or [PurchaseOrLeaseType] = "Gift"
Select the Gray color you wish.
Save and exit the Conditional Formatting dialog.

The above assumes the [PurchaseOrLeaseType] combo box's bound column
is a Text column. However, if the bound column of the
[PurchaseOrLeaseType] combo box is a Number datatype, then use the
corresponding number value instead of the displayed text value.

[PurchaseOrLeaseType] = 3 or [PurchaseOrLeaseType] = 5

Note: with the number values above no quotes around the value are
needed.
 
S

Sklyn

So, I need a code which is something like this;

In text box "MnthlyPaymentincStamp"
If data in text box "PurchaseOrLeaseType" is 'Purchase' or 'Gift'
Then make background in "MnthlyPaymentincStamp" turn Grey.

Please help..
 
S

Sklyn

I can't find an option in conditional format to work across different text
boxes.
Sorry if I'm missing something basic.
It just seems to me that it only refers to the formated box
 
S

Sklyn

ok, I found Freds post after following the accessmonster link in ur sig.
for some reason Freds post doesn't show up on MS community.. :(

Got it working perfect no, thanks Fred and Ling.
I'll paste Freds post here for anyone else to read if it doesn't show for
them too.

By fredg
In Form Design View, select the [MnthlyPaymentincStamp] control.
Then click on View + Conditional Formatting
As Condition1 select
Expression Is
In the next dialog box write:
[PurchaseOrLeaseType] = "Purchase" or [PurchaseOrLeaseType] = "Gift"
Select the Gray color you wish.
Save and exit the Conditional Formatting dialog.

The above assumes the [PurchaseOrLeaseType] combo box's bound column
is a Text column. However, if the bound column of the
[PurchaseOrLeaseType] combo box is a Number datatype, then use the
corresponding number value instead of the displayed text value.

[PurchaseOrLeaseType] = 3 or [PurchaseOrLeaseType] = 5

Note: with the number values above no quotes around the value are
needed
 

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