View Full Version : option group code


ebergoni
09-14-2001, 02:38 PM
Can anyone help, please... I'm still having a problem on my option group check boxes in a form. What i'm trying to do is to convert this option values check box into a string store in my table data field. Someone suggested me to do a select case statement (after update property). I tried to do it but the problem when i tick the chck box (Female) doesn't show a tick, appears only gray. When i check on the table field the result is Female. Fine but how will it show tick on my form. How could i solve this problem. I want only string to appear on the table field. My code are as follows:

Private Sub Gender_AfterUpdate()
Dim strGender As String
Select Case Gender
Case 1
strGender = "Female"
Case 2
strGender = "Male"
Case 3
strGender = "Not Specified"
End Select
Me![Gender] = "" & strGender
End Sub

Can someone fix this, Please help, i'm disperate solving. Thanks

Pat Hartman
09-15-2001, 07:16 PM
The value of the option group should be stored as an integer in the table. Otherwise, you will need to use an unbound field for the option group and translate the values in both the AfterUpdate event of the option group and the OnCurrent event of the form.

To display the numeric value as a text string in a query or on a report, use the Choose() function.