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

Eenable a Textbox via Chechbox

Status
Not open for further replies.

soupisgood84

Technical User
Apr 17, 2007
45
US
I am trying to have a check_box enable one or more of my Txt_boxes. I have place the below code in the before_update event. Could anyone help me out and let me know what I did wrong with this. Thanks ;)

Code:
If Nz(Me.Check28, True) = True Then
    Me.txtStartDate = Enabled
    Me.txtEndDate = Enabled
    End If
 
What you've got there looks like it should work (I got it to)

but try this instead:

Code:
Private Sub Check28_BeforeUpdate(Cancel As Integer)
    If Me.Check28= True Then
        Me.txtStartDate.Enabled = True
    Else
        Me.txtStartDate.Enabled = False
    End If
        
End Sub


Just to be sure, you put your code in the before_update event of the checkbox, right?

Kyle
 
I see where I went wrong.
Code:
Me.txtStartDate.Enabled = True
not
Code:
Me.txtStartDate = Enabled

Thank you for your help! ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top