'Controlling responses to questions following branching logic in a MS Access Form

So this question is related to a question I asked about earlier. I'm creating a form that has several questions with branching logic questions that follow. For example: "Do you smoke?" is followed by several questions such as "If yes, how often?" and "If yes, what cigarette brand?" As you can imagine, if the response to the first question is 'No' then it doesn't make sense for the second two questions to be enabled.

I've successfully been able to disable (gray out) the second two questions by opening up the Event Procedure in the Properties for the first question and used code that looked like this:

Private Sub blood_traceback_AfterUpdate()

If Me.Smoker = "Yes" Then
Me.HowOften.Enabled = True
Me.CigBrand.Enabled = True
Else
Me.HowOften.Enabled = False
Me.CigBrand.Enabled = False
End If

End Sub

This works beautifully except for one caveat. Suppose I enter 'Yes' in the form in response to "Are you a smoker?" and then proceed to enter the frequency and cigarette type for the next two questions. But then if I go back and change the response to 'No' or 'Prefer Not to Say' the next two questions are greyed out but they still have the responses recorded if I didn't delete them before changing the first question.

So what I'm wondering, is how would I set up the form to delete the responses in the questions "If Yes, How Often?" and "If yes, what cigarette brand?" if I changed my mind and switch the question "Are you a smoker?" to 'No' or 'Prefer Not to Say'.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source