I have a combobox cboQuestion1 with three possible values; 1, 2, 3
Underneath is three disenabled fields - one for each possible answer.
Code:
Private Sub cboQuestion1_AfterUpdate()
If Me.cboQuestion1 = 1 Then
Me.txtAnswer1Comments.Enabled = True
Me.txtAnswer2Comments.Enabled = False
Me.txtAnswer3Comments.Enabled = False
ElseIf Me.cboQuestion1 = 2 Then
Me.txtAnswer1Comments.Enabled = False
Me.txtAnswer2Comments.Enabled = True
Me.txtAnswer3Comments.Enabled = False
Else
Me.txtAnswer1Comments.Enabled = False
Me.txtAnswer2Comments.Enabled = False
Me.txtAnswer3Comments.Enabled = True
End If
End Sub
Is it possible to include an automatic deletion of the recorded value inside a textfield, when that textfield is set to enabled=false ?
E.g. the user chooses the value 1 for cboQuestion1, and records some text in field txtAnswer1Comments. The user then decides to change the value of cboQuestion1 from 1 to 2, and the previously recorded value of txtAnswer1Comments has to be deleted and the textfield disenabled. Textfield txtAnswer2Comments is enabled now enabled, and textfield txtAnswer3Comments remains unchanged.
Any suggestions or advice on this?