N
Niniel
Hello,
I have a parent table that is linked in a 1->many relationship to an Answers
table via RecordID. The Answers table in turn is linked to a Questions table
via QuestionID. The Answers table has the following fields - AnswerID (PK),
RecordID (FK), QuestionID (FK), Answer [yes/no field], Notes [txt].
On a form based on the parent table, I have a subform based on the Answers
child table, so that for one record in the parent table, several records from
that child table are shown in a continuous subform. They show the text field
[the question] and the yes/no field.
What I am trying to figure out is if/how I can create a system so that when
one specific checkbox is checked, an action is performed [I want to unhide
another subform on the main form that has nothing to do with the Answers
table, but is based on another child table].
I was thinking something along these lines might work:
if [Forms]![frmParentForm]![RecordID] and
tblAnswers.QuestionID(99) = true then
subform2.visible = true
else subform2.visible = false [is an else statement always required?]
end if
This is not really an attempt at coding, more an illustration, but the point
is that I believe I would have to reference the questionID and the recordID
in order to correctly identify the checkbox.
I would greatly appreciate if somebody could help me with the coding here.
Thank you.
I have a parent table that is linked in a 1->many relationship to an Answers
table via RecordID. The Answers table in turn is linked to a Questions table
via QuestionID. The Answers table has the following fields - AnswerID (PK),
RecordID (FK), QuestionID (FK), Answer [yes/no field], Notes [txt].
On a form based on the parent table, I have a subform based on the Answers
child table, so that for one record in the parent table, several records from
that child table are shown in a continuous subform. They show the text field
[the question] and the yes/no field.
What I am trying to figure out is if/how I can create a system so that when
one specific checkbox is checked, an action is performed [I want to unhide
another subform on the main form that has nothing to do with the Answers
table, but is based on another child table].
I was thinking something along these lines might work:
if [Forms]![frmParentForm]![RecordID] and
tblAnswers.QuestionID(99) = true then
subform2.visible = true
else subform2.visible = false [is an else statement always required?]
end if
This is not really an attempt at coding, more an illustration, but the point
is that I believe I would have to reference the questionID and the recordID
in order to correctly identify the checkbox.
I would greatly appreciate if somebody could help me with the coding here.
Thank you.