title: VB.NET How to display a messagebox if no radio button selected and clear them when next button clicked
body: <p>Hi I'm creating an examination system as school project. I'm using visual studio 2010 and back-end is MS Access 2007. I have 4 radio buttons and 1 button command(NEXT) on a form. </p>
  
  <p>How to display a Messagebox if all 4 radio buttons were unselected? Also , if one of the 4 radio buttons was selected, the answer should be inserted to the database and when the next button clicked to proceed to the next question the radio buttons should be cleared. </p>
  
  <p>My current code as shown below do as: If i checked the <code>radiobtnA</code> the answer A will be inserted to the database and when i click next button the radio buttons will all clear.</p>
  
  <p><a href="https://i.stack.imgur.com/GuVHR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GuVHR.jpg" alt="enter image description here"></a></p>
  
  <p>Below is my code:</p>
  
  <p><pre></p>
  
  <code>    Private Sub nxtBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nxtBTN.Click
      Dim EQcorrAnswer As Integer = 0
      Dim strAnswer As String = ""
  
      If radiobtnA.Checked = True Then strAnswer = "A"
      radiobtnA.Checked = False
      If radiobtnB.Checked = True Then strAnswer = "B"
      radiobtnB.Checked = False
      If radiobtnC.Checked = True Then strAnswer = "C"
      radiobtnC.Checked = False
      If radiobtnD.Checked = True Then strAnswer = "D"
      radiobtnD.Checked = False
  
       If corrAnsTB.Text = strAnswer Then
          EQcorrAnswer = 1
          intcorrAnswer += 1
      End If
  
      ExecNonQuery("UPDATE Examinee SET score = " &amp; intcorrAnswer &amp; " AND timefin ='" &amp; timetxt.Text &amp; "' AND datetaken ='" &amp; TXTDate.Text &amp; "' Where tempID = '" &amp; tempIDTB.Text &amp; "'")
  
  
      Try
          ExecNonQuery("INSERT INTO ExamResult (tempID,QuestionID,answer,correct) VALUES('" &amp; tempIDTB.Text &amp; "','" &amp; questIDTB.Text &amp; "','" &amp; strAnswer &amp; "'," &amp; EQcorrAnswer &amp; ")")
  
          If inc &lt;&gt; maxrows - 1 Then
              inc = inc + 1
              navigaterecords()
  </code></pre>