Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    364

    Unanswered: Help!! Need Combo box to Enable/Disable a Textbox!

    I need to use a combo box with YES or No to disable an empty text box when NO is selected in the combo box next to it.

    When YES is re-selected I want the combo box to re-enable the text box

    Cheers

    Tom

  2. #2
    Join Date
    Mar 2004
    Location
    San Diego
    Posts
    45
    Use an if statement in your code behind the combobox. Something like

    if cboYourBox="No" Then
    me.txtYourtextboxname.enabled = true
    else
    me.txtYourtextboxname.enabled = false
    end if

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    LaurelLee done it for you except....switch the True and False statements with each other and place the code into the OnClick event of your ComboBox:
    Code:
    If cboYourBox="No" Then  'If NO is selected...
       'If the textbox is actually empty...		Then disable it
       If IsNull(Me.txtYourtextboxname) then Me.txtYourtextboxname.Enabled = False
    Else   'Otherwise YES must be selected therefore make sure TextBox is Enabled.
       Me.txtYourtextboxname.Enabled = True
    End If

  4. #4
    Join Date
    Aug 2004
    Posts
    364
    Thanks allot! Got it sorted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •