Posted By

heislekw on 11/23/08


Tagged

disable enable


Versions (?)

Enable/Disable control based on value


 / Published in: Visual Basic
 

Concise version

  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  

You need to login to post a comment.