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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When I make like 5 option button in 1

Status
Not open for further replies.

juuso

IS-IT--Management
May 22, 2002
2
FI
When I make like 5 option button in a same frame what can I do that none of them is automaticly choosen when the program starts. Allways one of them have value true in the beginning even if I have not choose it.
 

Private Sub Form_Load()
Option1.Value = True
End Sub

Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Actually, you would set the value to False.
 
just set the property "Value" to True at desigin time

or

put this code in form load event

option1.value=true
 
There seems to be some confusion. If you want NO options selected, make sure the value property for all of them is False at design time, and/or set it to false using a loop like sunaj has. If you are making anything other than a survey though, you might want to reconsider. It is not considered user-friendly to have no options selected in many cases, and it opens up some awful doors. For instance, do you have a way to turn them all off again if the user changes his/her mind? One good approach is to have an extra option that equates to "none" or "unknown", or "unspecified". Make this one the default. This also gives you a default database entry value. For instance, having male or female options sounds great, but you obviously can't have one as the default or some embarassing mistakes happen. And, setting your database value to 0 or whatever, depending on there NOT being a gender selected is, well, sloppy. Since there IS the possibility that we might not know the gender of a client at the time the initial entry is made, it makes sense for the choices to be:

O Not specified (default)
O Male
O Female

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top