Disable field based on entry in another field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 50gumbys
    New Member
    • Dec 2006
    • 3

    Disable field based on entry in another field

    I have a field that uses a drop-list. When I select one of the options from the list, I'd like to make another field (it's a Yes/No field) on the form disabled, to ensure the user doesn't try to use it.

    I thought I could create an expression, using the IIF statement (thinking it was just like Excel); but haven't found how to deactivate the other field.

    Does anyone have any suggestions?
    Thank you - much appreciate your help.
    Love this website!
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by 50gumbys
    I have a field that uses a drop-list. When I select one of the options from the list, I'd like to make another field (it's a Yes/No field) on the form disabled, to ensure the user doesn't try to use it.

    I thought I could create an expression, using the IIF statement (thinking it was just like Excel); but haven't found how to deactivate the other field.

    Does anyone have any suggestions?
    Thank you - much appreciate your help.
    Love this website!
    You will need to create an After Update event on the combo box (drop down list) to disable or lock the other control. BTW, I am assuming you are talking about a form here as none of this can be done on the table.

    You will need something like this.

    Code:
    Private Sub comboName_AfterUpdate()
    
       If Not IsNull(Me.comboName) Then
    	  Me.CheckboxName.Locked = False ' User can't change the value
       Else
    	  Me.CheckboxName.Locked = True
       End If
    
    End Sub
    Mary

    Comment

    • 50gumbys
      New Member
      • Dec 2006
      • 3

      #3
      Hi Mary,

      Thank you SO much for your lovely solution!
      It works great !!!

      I've included a few other fields as well that need to be deactivated.
      (one day I'll get into VBA)

      Thanks again Mary - much appreciate your assistance.
      Lori

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by 50gumbys
        Hi Mary,

        Thank you SO much for your lovely solution!
        It works great !!!

        I've included a few other fields as well that need to be deactivated.
        (one day I'll get into VBA)

        Thanks again Mary - much appreciate your assistance.
        Lori
        You're welcome Lori and Merry Christmas

        Mary

        Comment

        Working...