+ Reply to Thread
Results 1 to 5 of 5

clear textbox if all checkboxes are false

  1. #1
    Registered User
    Join Date
    03-11-2017
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    59

    clear textbox if all checkboxes are false

    Hello Everyone,

    Need help here. I already attached the sample file.
    Per frame I have 3 checkboxes and a textbox. Example: I clicked on checkbox1 then caption will be shown on the textbox as shown however what I need help for is that if all textboxes are false then the textbox should be blank as well.
    I tried this code:
    Please Login or Register  to view this content.
    however I still have to double click the next checkbox I need to choose just to have it show on the textbox and it's not user friendly.

    Just to give a summary:
    If checkbox1,2,3 = false then textbox1.value = 1 and if checkboxes must only be clicked ONCE to have the caption added to the textbox.

    I hope someone can help me out. Thank you.


    UPDATE: there are 2 frames:
    If the checkbox value = 1 from frame 1 is checked then
    checkbox value = 1 from frame 2 should be blank and also the rest of the values to the frame1 checkbox2,3 = false
    Attached Files Attached Files
    Last edited by serenitylai; 08-23-2017 at 11:03 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,558

    Re: clear textbox if all checkboxes are false

    Can I suggest to use four option buttons (1,2,3 and None) instead of checkboxes. Optionbuttons are for when there is only one choice allowed. Checkboxes are usually used when multiple choices are allowed.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-11-2017
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    59

    Re: clear textbox if all checkboxes are false

    Quote Originally Posted by AlphaFrog View Post
    Can I suggest to use four option buttons (1,2,3 and None) instead of checkboxes. Optionbuttons are for when there is only one choice allowed. Checkboxes are usually used when multiple choices are allowed.

    Please Login or Register  to view this content.
    hi!
    Thank you for the suggestion however my boss wants a checkbox instead of optionbutton

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,558

    Re: clear textbox if all checkboxes are false

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-11-2017
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    59

    Re: clear textbox if all checkboxes are false

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    I appreciate the help however I forgot to mention that
    example:
    Frame 1
    checkbox1.caption = 1, checkbox2.caption = 2, checkbox3.caption = 3
    textbox1

    Frame 2
    checkbox4.caption = 1, checkbox5.caption = 2, checkbox6.caption = 3
    textbox2


    if checkbox1 = true then all checkbox2 , checkbox3, checkbox4 = false
    textbox1 = "1"
    else
    textbox1 = ""

    if checkbox4 = true then checkbox1 , checkbox5, checkbox6 = false
    textbox2 = "1

    else
    textbox1 = ""
    Last edited by serenitylai; 08-23-2017 at 11:21 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Covert Checkboxes To TRUE/FALSE
    By IcyBricks in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2019, 01:09 PM
  2. Control if all checkboxes are FALSE (then...)
    By menielsen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2016, 08:20 AM
  3. clear all checkboxes where values equal FALSE unless a checkbox is chosen
    By analystspec4 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2014, 07:58 PM
  4. Clear all checkboxes
    By bjohnsonac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2011, 06:12 PM
  5. Creating True or false checkboxes
    By L_ter in forum Access Tables & Databases
    Replies: 1
    Last Post: 03-19-2009, 12:04 AM
  6. Replies: 5
    Last Post: 07-29-2005, 08:05 PM
  7. [SOLVED] Clear All Checkboxes?
    By Brad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2005, 04:06 PM

Tags for this Thread

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