+ Reply to Thread
Results 1 to 8 of 8

Disable field by Uncheck a check box

  1. #1
    joe41
    Guest

    Disable field by Uncheck a check box

    Hi,

    I would like to disable the field in the form when anyone uncheck checkbox.
    No text should be written when the checkbox id unchecked.

    How can i do this???

    please help

    Thanks

  2. #2
    J.wills
    Guest

    Re: Disable field by Uncheck a check box

    You can try this code:

    Please Login or Register  to view this content.
    sets it to ticked

  3. #3
    joe41
    Guest

    Re: Disable field by Uncheck a check box

    Where would I place this code?

    Would I create an event procedure for the check box or would it go on the form? I have three check boxes on the form so I may need to select two out of three, and so on

  4. #4
    J.wills
    Guest

    Re: Disable field by Uncheck a check box

    Yes, you create an event for the box, on the form.

    Let's say, for example, that ticking box 1 automatically means that boxes 2 and 3 should be cleared. In the code behind the 'AfterUpdate' event of box 1, you'd add

    Please Login or Register  to view this content.

  5. #5
    joe41
    Guest

    Re: Disable field by Uncheck a check box

    How would I then clear a box that's selected without using an event from the other check boxes?

    For instance, I select box 1, change my mind and need to clear the check from box 1...without clicking on box 2 or 3.

    Almost like turning on a switch and then turning it off. I ask because I need to setup box 2 and 3 the same way. I ultimately need to run reports say with box 1 and 3 checked or 2 and 3 check, etc.

    Thank for the answer

  6. #6
    J.wills
    Guest

    Re: Disable field by Uncheck a check box

    When you manually click on box 1 it would unchecked it and, because there's no mention of what to do if it's false in the code, not affect boxes 2 or 3.

    If you mean how could you set it to false without clicking on it or on the other boxes, you'd need an event somewhere that would do it, whether that's behind a different item on the form, or behind one of the form's own events.

  7. #7
    joe41
    Guest

    Re: Disable field by Uncheck a check box

    If I check the box so that the

    value = 2007,like this me.checkbox.value = 2007,

    what code would I use to click on the box again and remove the value.

    If me.checkbox.value = 2007 then me.checkbox.value = null does not work.
    Any help is greatly appreciated.

  8. #8
    J.wills
    Guest

    Re: Disable field by Uncheck a check box

    If it's a checkbox, as opposed to a text field, I'm not sure you can set it to anything other than true or false?

    To clear it,
    try
    Me.CheckBox = False

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1