Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Gloucestershire, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dis enabling text boxes (2000)

    I have a series of text boxes which I want to be able to dis enable (i.e. enabled property no) if a particular check box is selected. On the basis that they are not relevant if the check box is true.

    I thought I had it cracked by turning on enabled no if I deselected the check box (I made it selected by default) but then found when I went on to the next record it stayed enabled no whether or not I had the check box selected in the currently viewed record.

    Ideally how can I make the text boxes enabled no if a check box selected on a per record basis?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dis enabling text boxes (2000)

    You need code in two places:
    - In the After Update event of the check box, to react to the user clicking the check box.
    - In the On Current event of the form, to set the status of the text boxes as the user moves from record to record.

    For example:

    Private Sub chkSomething_AfterUpdate()
    Me.txtText1.Enabled = Not Me.chkSomething
    Me.txtText2.Enabled = Not Me.chkSomething
    End Sub

    Private Sub Form_Current()
    Me.txtText1.Enabled = Not Me.chkSomething
    Me.txtText2.Enabled = Not Me.chkSomething
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Gloucestershire, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dis enabling text boxes (2000)

    Thank you so so much. You just don't know how much trouble this has got me out of!!!!!

    Roberta

Posting Permissions

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