Urgent Help Needed : Problem with YES/NO Option Group

Will04

Registered User.
Local time
Today, 15:39
Joined
May 29, 2006
Messages
62
Hi everyone,

I'm working on a form to accept patient's medical info.
One of the question on the form is 'whether an examination was done (Yes/No), if no, then a reason has to be entered why the examination was not done.

The field - ExamDoneYN is of data type YES/NO. I created an option group using the wizard and set the default to yes.

I have two(2) Questions which i need some assistance with:

1. When the form is displayed, the Yes box is ticked, however when i click on No the tick disappears and does not appear again - regardless if i click yes or no.

2. The second problem is whenever 'No' is checked, I want to enable a text box on the form (ReasonNoExam), so the user can enter the reason why the examination was not done. The textbox was previously disabled at the Form Open event.

Please see attached db.

I would appreciate any help on this. I need to complete this exercise today..

Thanks a million in advance.

Will
 

Attachments

ive not looked, but

is the text box INSIDE the option group frame ?- the frame box jumps to the top and hides the text box - i think you need to get the text box outside the frame

the option group is run by the frame itself - each chkbox in the group has an option value, normally 1,2,3 so in the frames afterupdate event you can put

sub framename_afterupdate

select case framename (ie whatever the name of the group is)
'test the value of the checked item
case 1: 'code to enable the text box
case 2: 'code to hide the text box
case 3: 'etc
end select

end sub
 
Hi gemma,
Thanks for responding.
First of all, the text box is outside of the frame, and this is the code that i have in the after update event

*********
Private Sub Frame44_AfterUpdate()
If Me![ExamDoneYN] = 2 Then
Me.ReasonNoExam.Enabled = True
Forms!CSMainfrm!CSExamfrm.Form!ReasonNoExam.SetFocus
Else
Me.ReasonNoExam.Enabled = False
Me.ReasonNoExam = ""
End If

End Sub
**********
I think the first problem to be settled is why the option group is not accepting the tick - nothing happens when I click on either boxes...

Any suggestions??


thanks again

Will
 
frame44 holds the option group

so for the options within the option group to mean anything the optiongroup has to examine the way you've set it

so it shouldnt be

if me.examdoneyn etc

it should test the values within frame44

- now each option in frame44 has a value (set for the chkbox, not the label)
and the value returned by frame44 is equal to the value of the selected radio button

so we get

frame44_afterupdate
select case frame44
case 1: etc
case 2: etc
case 3: etc
etc
end case


thats the way to do it


hope this helps
 
Problem Solved

Hi Gemma,

Thanks so much for your help. It working now.
The problem of the option not accepting the tick was that the data type of the field Examdoneyn was set as Yes/No instead of a number.

I also changed the after update event of the frame and it also works beautifully.

Thanks so much for all your help.

God bless

Will
 

Users who are viewing this thread

Back
Top Bottom