Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf statement Question 2

Status
Not open for further replies.

BubbaJean

IS-IT--Management
Joined
Jun 5, 2002
Messages
111
Location
US

The statement below works great, now the user want to add in additional requirements when selecting items
for example if the user select
CAPACITORS, [Composition] is enabled, if Composition ="Aluminum",
Turn off [TempCoef]
if other than "Aluminum"
Turn off [RippleCurrent] and [CurrentLeakage]

how do I update the code below to include these new rqmts??


If txtInvisible = "CAPACITORS" Then

Me!Composition.Enabled = True
Me!RippleCurrent.Enabled = True
Me!CurrentLeakage.Enabled = True
Me!TempCoef.Enabled = True
Else
Me!Composition.Enabled = False
Me!RippleCurrent.Enabled = False
Me!CurrentLeakage.Enabled = False
Me!TempCoef.Enabled = False
End If
 
If txtInvisible = "CAPACITORS" Then

Me!Composition.Enabled = True
Me!RippleCurrent.Enabled = True
Me!CurrentLeakage.Enabled = True
If Composition = "Aluminum" Then
Me!TempCoef.Enabled = False
Else
Me!RippleCurrent.Enabled = False
Me!CurrentLeakage.Enabled = False
End If
Else
Me!Composition.Enabled = False
Me!TempCoef.Enabled = False

Try this

Paul


You don't say if you want to do anything
End If


 
How do I get the fields to turn back on if Aluminum is or isn't selected??
 
I got this to work (see code below) Thanks for the help


If txtInvisible = "CAPACITORS" Then
Me!RippleCurrent.Enabled = True
Me!CurrentLeakage.Enabled = True
Me!TempCoef.Enabled = True
If Composition = "Aluminum" Then
Me!TempCoef.Enabled = False
Me!CurrentLeakage.Enabled = True
Me!RippleCurrent.Enabled = True
Else
Me!TempCoef.Enabled = True
Me!CurrentLeakage.Enabled = False
Me!RippleCurrent.Enabled = False
End If
Else
Me!RippleCurrent.Enabled = False
Me!CurrentLeakage.Enabled = False
Me!TempCoef.Enabled = False
End If
 
Just make a small change to the following portion of the if statements:

If Composition = "Aluminum" Then
Me!TempCoef.Enabled = False
Else
Me!RippleCurrent.Enabled = False
Me!CurrentLeakage.Enabled = False
Me!TempCoef.Enabled = True
End If

I added one line to the Else portion.
 
Thanks for the star, but I really did not do anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top