473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How do I code an option to deselect if another is selected?

Hi I'm trying to create a simple interface for data entry. Everything else is working fine but I'm having trouble with one thing.

A question must have an answer, either "Yes" or "No", but not both. I want to use a control button for this but if I amend the properties to be a "Yes/No" response, then I only see an option to select or deselect - not two options. I have tried to create two and code it to create a rule whereby selecting "Yes" deselects "No" and vice versa...but "No" always stays selected.

Further to this, if "Yes" is selected then the user will be asked for more information.

Help!
Nov 8 '10 #1
3 3029
NeoPa
32,556 Expert Mod 16PB
You should probably be looking at AfterUpdate events for both controls. Controls could be either CheckBoxes or RadioButtons. The code in both event procedures should set the value of the other control to Not itself, then go on to enable/disable (or lock/unlock, or even hide/show) the controls where further information is entered.

Does this make sense?
Nov 8 '10 #2
Thanks! It made sense but I kept on getting error messages and just went with an "Option Box" in the end. Now I have the issue of what to do when the "Yes" option has the "On got focus" status. I'll keep playing around, I'm sure (/hope) something will work out. Thank you for your help!
Nov 8 '10 #3
NeoPa
32,556 Expert Mod 16PB
When using RadioButtons an OptionGroup is most commonly used. The nice thing about this is that the RadioButton states are all managed by the OptionGroup control whenever one is selected. It also means you needn't handle the RadioButton events themselves, but can use the AfterUpdate() event procedure of the OptionGroup instead. Does that point you along the right lines? We can help more if you get stuck.
Nov 9 '10 #4

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

Similar topics

1
by: Keiron Waites | last post by:
Hi, I have two select fields with the multiple attribute so you can see all options. When a user clicks on one form, I would like to deselect anything from the other form. Is there a way to do...
8
by: Peter Nolan | last post by:
Hi All, I have written some software that performs ETL processing to load data warehouses. Each program accepts a set of parameters and returns 0 or 1 to the win/unix shell to indicate success or...
1
by: Søren M. Olesen | last post by:
Hi On IE one can call a function loaded by another frame, using the following code: window.parent.frames('myFrame').myFunction('myParameter'); however this doesn't work in FireFox....is...
4
by: thomastk | last post by:
Hi, In the following script, I am trying to set selection to a select option element, that is newly created within the script. It works fine on IE installations on Windows 2000 and some XP...
1
by: dev.amit | last post by:
Hello friends Can anyone tell me how to deselect the item selected in the list box If Me!lb_test_property.ItemsSelected.Count > 0 Then For Each varItem In Me!lb_test_property.ItemsSelected...
6
by: ducky | last post by:
I have set up two option buttons. When option button 1 is selected I need to make sure that the combo box located beside Option button 2 is cleared. In turn I need to make sure that if a value is...
5
by: kodt | last post by:
I need to set an option from a select box to be selected based upon a value I am pulling from a database. I cannot alter the code of the select box in this case, so I must use javascript to...
1
by: unnikrishnan123 | last post by:
C# code for storing a selected date time value to a variable. using a DateTimePicker.
3
by: ladycyradis | last post by:
Hi, I'm new here and have a bit of a problem. I'm building a form in Access 2003 and have a piece of code I'm using to ensure that the correct values are saved in the table when each option is...
2
by: felipebucaram | last post by:
Hi , I'm making a useform and I want people to say if they are single cheking an option box, and if they're not single i need them to write their wife name. I already have the 2 option boxes (to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.