Link to home
Start Free TrialLog in
Avatar of 98fatboyrider
98fatboyrider

asked on

Radio button selection gives same results

I've created a group of radio button being used to select the correct answer of a question. I'm unsure why, but regardless of which one is selected, it always displays correct. Any suggestions?
~TIA
Private Sub btbOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btbOK.Click
        Timer1.Enabled = False
        Dim BoardForm As New frmQuestion
        If RB1.Tag = m_CorrectAnswer OrElse RB2.Tag = m_CorrectAnswer OrElse RB3.Tag = m_CorrectAnswer OrElse RB4.Tag = m_CorrectAnswer Then
            PlayerTotal = (m_sender * 200) + PlayerTotal
            MessageBox.Show("Correct!", "Correct", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Else
            MessageBox.Show("Sorry", "Wrong", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End If

Open in new window

Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

With this :
"If RB1.Tag = mm_CorrectAnswer OrElse RB2.Tag = m_CorrectAnswer OrElse RB3.Tag = m_CorrectAnswer OrElse RB4.Tag = m_CorrectAnswer Then"
If any one of the radio buttons = m_CorrectAnswer then you will have a correct answer.
 
If have to include in each one if the radiobutton is selected and the tag = m_CorrectAnswer
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 98fatboyrider
98fatboyrider

ASKER

That was it. Thank you.