• dis enabling text boxes (2000)

    Author
    Topic
    #415913

    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

    Viewing 0 reply threads
    Author
    Replies
    • #928660

      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

      • #928669

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

        Roberta

    Viewing 0 reply threads
    Reply To: dis enabling text boxes (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: