Click here to Skip to main content
15,885,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I cant seem to find the right codes to validate phone, group, GPA.

For a student data entry. Can someone help me please.
FOR A STUDENT DATA ENTRY CAN SOMEONE HELP ME PLEASE

VB
Private Sub btnPhone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPhone.Click
      Dim number As Integer
      If txtData.Text.Length = 3 Then
          txtData.Text = txtData.Text + "-"
      End If


========
UPDATE from a repost by OP:

Create a VB project called “Students”
Design and create GUI (name all the controls properly)
Create a text file on Notepad called “Students.txt”; add at least 20 entries (records) in the file
FOR VALIDATION I HAVE THIS :

VB
Private Sub btnEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmail.Click
        Dim Symbol1 As Integer
        Dim Symbol2 As Integer
        Dim TestString As String

        TestString = txtData.Text
        Symbol1 = InStr(TestString, "@")
        Symbol2 = InStr(TestString, ".")


        If (Symbol1 < Symbol2) Then
            MsgBox("Valid E-mail Accepted")
        Else
            MsgBox("Please re-enter a valid e-mail address")
        End If
    End Sub

    Private Sub btnPhone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPhone.Click

        Dim number As Integer

        If txtData.Text.Length = 3 Then

            txtData.Text = txtData.Text + "-"

        End If


(I STILL NEED PHONE, gpa, and group)
Posted
Updated 28-Mar-11 5:26am
v4

1 solution

Here:
How to validate phone, zip etc[^]

Other way is to use Regular Expressions. Try!
 
Share this answer
 
Comments
Member 7780316 28-Mar-11 11:26am    
i have a button for phone validation how do i out a public funtion into the private one?

- Private Sub btnPhone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPhone.Click

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900