Enable/Disable control based on value


/ Published in: Visual Basic
Save to your folder(s)

Concise version


Copy this code and paste it in your HTML
  1. ' Text field
  2. Me.RaceOther.Enabled = IIf(Me.Race = "Other", -1, 0)
  3.  
  4.  
  5. ' Text field with multiple criteria
  6. ' Because of the OR statement, it will always
  7. ' evaluate to True or False, so the IIf ... stuff isn't needed.
  8.  
  9. Me.txtColor.Enabled = (Me.cboColor = "Green" Or Me.cboColor = "Blue")

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.