option button: Select Case on _AfterUpdate()

dbertanjoli

Registered User.
Local time
Today, 20:34
Joined
Sep 22, 2000
Messages
102
I am using this event procedure on my form to convert option button numerical values into text. It works fine, text goes into the table, except on my form the option button don't look selected. Any suggestions please?


Private Sub optSuccess_AfterUpdate()
Select Case optSuccess
Case 1
Me.txtFieldName = "very often"
Case 2
Me.txtFieldName = "often"
Case 3
Me.txtFieldName = "occasionally"
Case 4
Me.txtFieldName = "rarely"
Case 5
Me.txtFieldName = "never"
End Select

End Sub
 
optSuccess is the name of your OptionGroup, correct? What you have should not effect what the OptionGroup looks like or how it behaves.
 
Actually it worked fine until I enter this code, when I remove it it wors fine again. Any suggestions?
 
I have 2000 and 2003. Data is going to right place, just on the form doesn't show selection (it does in text field but not at the option group).

Many thanks
p.s. is there any other away to do this?
 
I just did a test with basically your Select Case structure in the AfterUpdate event of my OptionGroupFrame and it works just a I would expect. I also have 5 buttons and am writing to a TextBox.
 
The buttons on mine change the highlighting as I select another button. Yours *should* work. Do you want to post a stripped down sample with the problem so we can look at it?
 
Here it is. Look at the subforms (SFrmCooperationAmongStudentBefore), last group, called TestField. Then test it in MainForm. I am working with student evaluation forms (before and after the course).

I am also trying to figure out the following;

One student evaluates course before and after. There is several questions related to this evaluation (all are same before and after) and for one question there is 5 possible answer (stored in option group)

I would like to build a report or a query where I can compare data from each student (before and after) for all questions. Is this possible to do in access.

So, StudentA: questionOn: answer: one columen: before, second column: after…. Next question.

Very greatful,

Debbie
p.s. I hope I uploaded attachment successfuly.
 
I'm sorry Debbie, but the 1st OptionGroup in the SubForm seems to work as I would expect. Visually they all seem to work as expected. Here's your db back. I made some changes but I don't believe they had anything to do with the way the OptionGroups behave. Let me know if this one screws up like yours.
 

Attachments

Users who are viewing this thread

Back
Top Bottom