Custom Search
Your Ad Here
Latest News

Function For Validation Each Fields( Numeric Or Empty)

9/4/08 , Posted by Gregfox at 6:42 PM

Private Function Validat(ByRef Target As Integer, _
ByRef HighestBSL As Integer, _
ByRef LowestBSL As Integer, _
ByRef HighestA1c As Integer, _
ByRef LowestA1c As Integer, _
ByRef Remarks As String _
) As Boolean


Dim isvalidat As Boolean = False

If Target = 0 Or txtTarget.Text = String.Empty Or Not IsNumeric(txtTarget.Text) Then
MessageBox.Show("Enter Target Sugar Management Plan Or Enter Numeric Only", "Try Again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtTarget.Focus()
isvalidat = False


ElseIf HighestBSL = 0 Or txtHighestBSL.Text = String.Empty Or Not IsNumeric(txtHighestBSL.Text) Then
MessageBox.Show("Enter Highest blood sugar level Or Enter Numeric Only", "Try Again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtHighestBSL.Focus()
isvalidat = False

ElseIf LowestBSL = 0 Or txtLowestBSL.Text = String.Empty Or Not IsNumeric(txtLowestBSL.Text) Then
MessageBox.Show("Enter Lowest blood sugar level Or Enter Numeric Only", "Try Again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtLowestBSL.Focus()
isvalidat = False

ElseIf HighestA1c = 0 Or txtHighestA1c.Text = String.Empty Or Not IsNumeric(txtHighestA1c.Text) Then
MessageBox.Show("Enter Highest A1c level Or Enter Numeric Only", "Try Again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtHighestA1c.Focus()
isvalidat = False
ElseIf LowestA1c = 0 Or txtLowestA1c.Text = String.Empty Or Not IsNumeric(txtLowestA1c.Text) Then
MessageBox.Show("Enter LowestA1c level Or Enter Numeric Only", "Try Again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtLowestA1c.Focus()
isvalidat = False
ElseIf Remarks = String.Empty Then
MessageBox.Show("Enter Remarks ", "Try Again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtRemarks.Focus()
isvalidat = False

Else
isvalidat = True
End If

Return isvalidat

End Function

Currently have 4 comments:

  1. AC says:

    sa sunod try nako nah
    heheheh...

  1. Gregfox says:

    hehehehe...try lng na!!

  1. Gregfox says:

    hehehehe...try lng na!!

  1. Gregfox says:

    hehehehe...try lng na!!

Leave a Reply

Post a Comment