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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable or disable a control based on criteria

Status
Not open for further replies.

williekay

Technical User
Jun 30, 2003
121
US
I have a calculated field on a form HM.

Code:
=IIf(DMin("[ID1]","[Production Schedules]","HNumber = " & [HNumber] & " AND SJoin = '" & [Sjoin] & "'")=[ID1],DSum("[PourWeight]","[Production Schedules]","HNumber = " & [HNumber] & " AND SJoin = '" & [Sjoin] & "'")+[KBw],"X")

HM will either give me a number or a X. I have a combo that is set to Yes/No. I would like to either enable the combo if HM is a number -- IsNumber([HM]), or disable HM if it equals X.


Willie
 
Hi

You need to place the code below in the 'On Current' Event of the form:

If IsNumeric(Me.HM) Then
Me.ComboName.Enabled = True
ElseIf Me.HM = "X" Then
Me.ComboName.Enabled = False
Else
What you want to do if not numeric or "X"..
End If

You will also need to place this code in the After_Update Event for HM if it changes.

hope this helps.

Mark...

[Worm]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top