conditional formating

G

Guest

Hey MVPs

I have a Field "WB-Balance"
I have a second field "Quantity" which is the field I want to apply
conditional formating to.

In the conditional formating window I choose expression is and I type the
following expression IIF(([WB_Balance])="0"}

This is the first time I am dealing with conditional formating I really dont
knowing anything

I want the "Quantity" field to be unavailable if the "WB_Balance" field has
a value of Zero can that work???

Help!
 
J

jleckrone

Your IIF Statement is another way of writing and IF..THEN..ELSE
statement.
IF <condition> is True Then
Do This
ELSE
Do This
End IF

IIF is the same way. IIF(<Condition>, Do this if True, Do this if
False)

I think what you are going to want in this example is an IF..Then..Else

If Me.[WB_Balance] = 0 Then
Me.Quantity.Enabled = False
Else
Me.Quantity.Enabled = True
End IF

I'd put this statement in the On Current event of your form.

Hope that helps!
 
G

Guest

Hi.

Is Quantity a text field? If not, there shouldn't be any quotes around the
zero.

Try this: IIF(([WB_Balance])=0,True,False)

And, make sure that the Enabled toggle button in the Conditional Formatting
box is set to Disabled.

If Quantity really is a text field, then use this instead:
IIF(([WB_Balance])="0",True,False)

-Michael
 
G

Guest

I'd actually prefer to use the On Current event as well. Here's an even
shorter bit of (air) code for using that method:
Me.Quantity.Enabled = Not(Me.[WB_Balance] = 0)

-Michael
 
S

Steve Schapel

Levans,

You're making it more complicated than it needs to be. Just enter it
like this...
[WB_Balance]=0
 

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