Dynamically showing a third option button

M

MKMurphy

I am creating a form with Yes and No option buttons. However, some questions
don't apply, and I need to display an option button NA for those questions.
My underlying table is set up as such: PKQuestionID, QuestionText,
Response(this is the only field the user changes), and IsResponseRequired. I
have optNA.Visible=False. My form is Continuous View. I want to read the
value of IsResponseRequired and if =0(meaning the user doesn't have to answer
the question) then make optNA visible so they can choose it.

Question is, where do I place the code? Not in Form.Load or Detail.OnPaint.

thanks,
MKM
 
K

Ken Snell MVP

"No go" means what? In a Continuous Forms view, the record that you're on
will dictate whether the button is visible -- ON ALL RECORDS seen. When you
switch to a record where the button is to be invisible, all the records will
not show the option button. If you switch to a record where the button is to
be visible, all the records will show the option button.

The code for the Current event would be something like this:

Private Sub Form_Current()
Me.optNA.Visible = (Me.IsResponseRequired <> 0)
End Sub
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top