Erel,
This behaviour looks strange.
I renamed PrevBtn to PrevBtn1
I added a new button named it PrevBtn
Deleted button PrevBtn1
Renamed Sub PrevBtn1 back to Sub PrevBtn
And it works normally. Source QuestionExampleNew
in this code when PrevBtn.Enabled=False is executed,
the Radio_Click routine is not called.
I also tried the following code
in this code when PrevBtn.Enabled=False is executed,
the Sender in the Radio_Click routine is RadioButton1
Sub ShowData
Label1.Text="Q"&(AnsRec+1)&". "
If Answer(AnsRec)=0 Then
For i=1 To 5
Control("RadioBtn"&i).Checked=False
Next
Else
Control("RadioBtn"&Answer(AnsRec)).Checked=True
End If
If AnsRec=0 Then
PrevBtn.Enabled=False
NextBtn.Enabled=True
Else If AnsRec=5 Then
PrevBtn.Enabled=True
NextBtn.Enabled=False
Else
PrevBtn.Enabled=True
NextBtn.Enabled=True
End If
End Sub
instead of
Sub ShowData
If AnsRec=0 Then
PrevBtn.Enabled=False
NextBtn.Enabled=True
Else If AnsRec=5 Then
PrevBtn.Enabled=True
NextBtn.Enabled=False
Else
PrevBtn.Enabled=True
NextBtn.Enabled=True
End If
Label1.Text="Q"&(AnsRec+1)&". "
If Answer(AnsRec)=0 Then
For i=1 To 5
Control("RadioBtn"&i).Checked=False
Next
Else
Control("RadioBtn"&Answer(AnsRec)).Checked=True
End If
End Sub
in this code when PrevBtn.Enabled=False is executed,
the Sender in the Radio_Click routine is RadioButton2 which gives the wrong information.
Best regards