472,325 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

Disabling selected checkboxes when one other checkbox is selected

2
Please help. I have, say, 10 checkboxes on a form. I would like the form to disable, say checkbox 7 and 8 if I select checkbox 1. How do I achieve this.
Jan 17 '07 #1
6 16408
MMcCarthy
14,534 Expert Mod 8TB
Please help. I have, say, 10 checkboxes on a form. I would like the form to disable, say checkbox 7 and 8 if I select checkbox 1. How do I achieve this.
In the After Update event of checkbox 1 you can put the following code. I am using 'check1' as the checkbox name you will need to change it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub check1_AfterUpdate()
  2.  
  3.    If check1 Then ' if checkbox 1 is ticked
  4.       Me.check7.Enabled = False
  5.       Me.check8.Enabled = False
  6.    Else
  7.       Me.check7.Enabled = True
  8.       Me.check8.Enabled = True
  9.    End If
  10.  
  11. End Sub
  12.  
Mary
Jan 17 '07 #2
Tafi
2
Thanks lots Mary. It works great.
Jan 17 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Thanks lots Mary. It works great.
That's good Tafi

I'm glad to hear it.

Mary
Jan 17 '07 #4
NeoPa
32,511 Expert Mod 16PB
Another way of doing it :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check1_AfterUpdate()
  2.     Me!Check7.Enabled = Not Me!Check1
  3.     Me!Check8.Enabled = Not Me!Check1
  4. End Sub
Jan 18 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
Another way of doing it :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check1_AfterUpdate()
  2.     Me!Check7.Enabled = Not Me!Check1
  3.     Me!Check8.Enabled = Not Me!Check1
  4. End Sub
Did you do this while you were talking to me Ade or since.

Anyway, I remembered this after I posted but am so used to doing it the other way I didn't think of this at the time.

Mary
Jan 19 '07 #6
NeoPa
32,511 Expert Mod 16PB
I think this was before in fact.
Jan 19 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Maggie Eusebio Schock | last post by:
Hi, I would like to understand when a selected cell, selected row or selected rows in the DataGrid control ends up on the clipboard. All I know...
1
by: Nitesh Jain | last post by:
I want to write a simple utility, so that if I select a text, and press a hot key say (CTRL+ALT+G), then I should be able to open a google search...
0
by: sam | last post by:
I have 2 radio buttons on my form which are hidden. I need to have these radio buttons visible once a checkbox is selected. The radio buttons are...
2
by: Alex Smith | last post by:
Hi Friends, How can I check a checkbox selected more than one times in DataGrid ? My First Priority is check with Client Side(Java Script), if it...
1
by: zoneal | last post by:
Hello there, Currently I am working with the project which needs dynamically generated checkboxes and i have generated dynamic checkboxes but...
0
by: jlrolin | last post by:
Tearing my hair out over this, and it may be a postback problem of some sort. I have everything displaying, etc. BUT when I click the "Run...
0
by: prpleprncs | last post by:
I have a form that has a five checkboxes. Two of the checkboxes (let's call them box4 and box5) cannot both be checked. For example, if box4 is...
3
by: vinpkl | last post by:
hi all i want to insert all selected checkboxes values with a comma separator in database in one single column. i m able to echo all the...
3
by: BaseballGraphs | last post by:
Hello, I am looking to disable all checkboxes when one checkbox is selected. I cannot use radio buttons, so I need to be able to disable the...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.