473,387 Members | 1,721 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,387 software developers and data experts.

Option Button Script

Hi guys Goodmorning i need a big help, can anyone give me a script for option button, i have create a application form which i must create a option button
this is the scenario
Types of leave

button 1 - Vacation
button 2 - Sick
button 3 - Other (Specify) _____

the user must choose only one button so if they click one of the button the other 2 will be disable and if i the user choose the (Other button) they fill up the specify text box that will update my table, what will be my code for this? thanks very much for the help
Mar 6 '07 #1
4 2636
ADezii
8,834 Expert 8TB
Hi guys Goodmorning i need a big help, can anyone give me a script for option button, i have create a application form which i must create a option button
this is the scenario
Types of leave

button 1 - Vacation
button 2 - Sick
button 3 - Other (Specify) _____

the user must choose only one button so if they click one of the button the other 2 will be disable and if i the user choose the (Other button) they fill up the specify text box that will update my table, what will be my code for this? thanks very much for the help
The easiest way to accomplish what you are requesting is via the Option Group Wizard. Here is the procedure.
__01. Create a Field say [Leave_ID](LONG) in the underlying Record Source (Table) for your Application Form.
__02. Create a Field in the same manner named [Other](TEXT).
__03. Create a Text Box on your Form and name it txtOther. This Text Box cannot be within the Option Group you are about to create. Set its Visible Property to No.
__04. View ==> Toolbox ==> Option Group. Size it appropriately on your Application Form.
__05. Whem prompted for Label Names enter: Vacation, Sick, and Other (Specify).
__06. Select No default.
__07. When prompted for Values for your Options stay with the Defaults of 1, 2, and 3.
__08. When asked, store the Value in the [Leave_ID] Field.
__09. Select Option Buttons then select an appropriate Style.
__10. Name your Option Group fraLeave.
__11. Place this code in the AfterUpdate() Event of the Option Group. When Option 3 is selected Other (Specify), the Text Box will become Visible. If any one of the other two Options is selected, it will be Invisible.
__12. Make sure the Control Source for txtOther is set to the newly created [Other] Field.
Expand|Select|Wrap|Line Numbers
  1. Private Sub fraLeave_AfterUpdate()
  2.    Me![txtOther].Visible = Me![fraLeave].Value = 3
  3. End Sub
Mar 6 '07 #2
HEy Thank u very much i really appreciated your help it helps BIGTIME THANKS THANKS THANKS....I JUST TESTED IT AND IT WORKS
Mar 6 '07 #3
ei but wait y everytime i click the other button the text box which i hide doesnt appear in my form
Mar 6 '07 #4
ADezii
8,834 Expert 8TB
ei but wait y everytime i click the other button the text box which i hide doesnt appear in my form
Change the Name to your Text Box Name.
Mar 6 '07 #5

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

Similar topics

2
by: Craig Keightley | last post by:
How do I retrive the Name of the item in a select box I have the following form <select name="select"> <option value="1">Monday</option> <option value="2">Tuesday</option> <option...
2
by: mike | last post by:
I need to be able to select a specific option in a select list. This is what I have: <select name="mysel"> <option value=""></option> <option value="1">First</option> <option value="2"...
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...
8
by: McKirahan | last post by:
Firefox does not reflect selected option via innerHTML How do I get Firefox to reflect selected option values? <html> <head> <title>FFinner.htm</title> <script type="text/javascript">...
2
by: NishSF | last post by:
Would anyone have any suggestions/javascript code so that if one clicks the Radio Button "Yes" below he has the option of selecting any of the six CheckBox below. If the user clicks on Radio Button...
2
by: Manish Tomar | last post by:
Hi All, As far as my understanding of HTML DOM aka DHTML goes, is that if the DOM structure of HTML document is changed programmatically using JavaScript in the browser, it immediately gets...
1
by: sparksol | last post by:
I have a form with a drop down box. If you select an option in the drop down box (depending which option is selected) one or two textbox(es) and a submit button display. I would like to keep the...
1
by: vraamu | last post by:
here in this option transfer code.after transfering data from available _services multiple box to assigned_services multiple box i am unable to get the value of the assigned_services data for ex in...
3
by: Venturini | last post by:
I am trying to put together a web page where the customer makes choices of products and is then given a total. I am extremely new to Javascript and have managed to get as far as I have from web...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.