I am using Visual Basic for a Psychology experiment and I would like to check and see if the participants answered all of the questions on one form before moving on to the next. So far this is what I have done and it is not working.
If txbAge.Text = String.Empty Then
MsgBox("Wie Alt bist du?")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
If female.Checked = False And male.Checked = False Then
MsgBox("Was ist dein Geschlecht?")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
If txbMajor.Text = String.Empty Then
MsgBox("Was studierst du")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
If txbSemester.Tex t Is Nothing Then
MsgBox("In welchem Semester bist du?")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
Using this code, it does check to see if the textboxes are empty but if the participant clicks on the next button without answering any of the questions the message boxes appear one after the other and then the next form appears without giving the participant the chance to answer the items they missed. I am sure this code is not the most efficient or best way to do this (obviously since it isn't working) and would appreciate any and all help. I am completely new at programming.
Thanks!
If txbAge.Text = String.Empty Then
MsgBox("Wie Alt bist du?")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
If female.Checked = False And male.Checked = False Then
MsgBox("Was ist dein Geschlecht?")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
If txbMajor.Text = String.Empty Then
MsgBox("Was studierst du")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
If txbSemester.Tex t Is Nothing Then
MsgBox("In welchem Semester bist du?")
Else : Me.Hide()
AnagramExample. ShowDialog()
End If
Using this code, it does check to see if the textboxes are empty but if the participant clicks on the next button without answering any of the questions the message boxes appear one after the other and then the next form appears without giving the participant the chance to answer the items they missed. I am sure this code is not the most efficient or best way to do this (obviously since it isn't working) and would appreciate any and all help. I am completely new at programming.
Thanks!
Comment