I would suggest you to go this way:
Public Sub SaveRecord()
For Each item As Control In GroupBox1.Controls
If String.IsNullOrEmpty(item.Text) Then
MsgBox("Please fill up all fields............." & item.Name)
item.Focus()
Exit Sub
End If
Next
If MsgBox("Do you want to save this record?", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
End If
End Sub
The advantage of using this solution is:
1) You can point out the textbox that the user is missing or left unfilled.
2) This way you don't have to iterate to all textbox controls and make decision at the end.
3) No need of additional variable.
Hope it is useful for you since you are newbie.