I'm using VB2005 and have a group box that contains 2 to 4 radio buttons. When the user clicks the next button, the form will display the next set of 2-4 buttons in the group box. The program will also check to see if an actual button has been selected with the CheckChange Event. This all works except on the initial form load. If I press the next button without selecting a radio button in the first group, it still moves on to the next group. I've used the grpGroupBox.Tag = -1 and If/Then statements (which work on the subsequent groups) in various places and still can't get it to work. Any help is greatly appreciated!!
CODE
Private Sub frmTesting_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dsQuiz = oQuiz.GetData()
lblTestName.Text = sTestName
'hook up control array
rdoAns(1) = rdoAns1
rdoAns(2) = rdoAns2
rdoAns(3) = rdoAns3
rdoAns(4) = rdoAns4
'retrieve the info from the view
dtQuizQuesAns = oQuiz.GetQuizQuesAns(iTestID)
dtQuizQuesAns.TableName = "qryQzQstnAnsr" 'the tablename prop must not be "" to hook to a view
'show the first question
vwQ.Table = dtQuizQuesAns
grpChoices.Tag = -1
Call ShowAnswers(iCurrentQues)
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
If grpChoices.Tag = -1 Then
'haven't answered question
MessageBox.Show("Please answer the question before you continue.")
Else
iCurrentQues += 1
If Not ShowAnswers(iCurrentQues) Then
iCurrentQues -= 1 'went to far - back up one
ShowAnswers(iCurrentQues)
End If
grpChoices.Tag = -1
End If
rdoAns(1).Focus()
End Sub