Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Buttons 1

Status
Not open for further replies.

sunny12

Programmer
Nov 2, 2007
6
0
0
US
I have a table which contains the field, Section, Applicable and completed.

The fields Applicable and Completed requires YES or NO.Their Data type is Text.

I have a form in which i have option buttons to select yes or no, and the selected value is placed in the table.

option buttons seems to work, but the values appear as 1 for YES and 2 for NO., whereas i want "Yes" to appear instead of numbers in the table.

I tried changing the option value of the OPTION BUTTONS, but it seems to accept only numbers.

Please Help.
 
Option buttons only use numbers. They are EVIL.

That said my recomendation would be a combobox or listbox that can be set to store the text.

Another alternative if you can specify a zero would be to set an option number to 0 and the other to 1. Then change the datatype to Yes/No. That way you are storing the data as an appropriate datatype.

Finally to accomplish what your really asked, you could make the option group unbound and on its afterupdate event conditionally set the value of the field and on the form's on Current event set the value of the option group. Sample code for the afterupdate event is below. You basically reverse the control and field for on current and the values being read or set.

Code:
Sub optApplicable _AfterUpdate
     Select Case optApplicable 
        Case 1
            Me!Applicable = "Yes"
        Case 2
            Me!Applicable = "No"
     End Select
End Sub

I guess another alternative would be to store the numbers and make a table listing the values and joining it to the other table anytime you wanted to see the words.
 
Why not simply use Boolean (YesNo) fields and CheckBox controls ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top