when i login it will come 2 form one is info and other one is register form when i login that time my info come out come a samll form say error complet the box it should not come out this..!! where go worng

Edited 2 Years Ago by Xiao_1

Attachments pic1.jpg 72.2 KB pic2.jpg 73.53 KB

Inspect the codes to locate where you write codes for showing the forms.
The small window is a message box that you call for invalid text in the form info.

i find out it is becouse of this:
should i take out? or change another code?
how to do..!!

Private Sub Student_Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

** If String.IsNullOrWhiteSpace(txtadmno.Text) Or String.IsNullOrWhiteSpace(txtcard.Text) Then
MessageBox.Show("Please complete the on the box.", "Authentication Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If**

    Using conn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\temp\Database1.accdb")

        Dim Result As Integer
        Dim sql As String = "Select [Date Select] From tbl_studentadm values (@DateSelect)"

        Dim cmd As New System.Data.OleDb.OleDbCommand(sql, conn)

        cmd.Parameters.Add("@dateselect", OleDb.OleDbType.Date).Value = DTP.Value
        conn.Open()
        Result = cmd.ExecuteNonQuery()

        If Result > 0 Then
            MessageBox.Show("Successfully.")
        Else
            MessageBox.Show("This date you did have it.")
        End If

        cmd.Parameters.Clear()
        cmd.Dispose()
        conn.Close()
    End Using

    'Catch ex As Exception
    'MessageBox.Show("Failed to connect to Database..", "Database Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    'End Try


End Sub

Edited 2 Years Ago by Xiao_1

Do not understand , what do you want by the following SQL Statement?

Dim sql As String = "Select [Date Select] From tbl_studentadm values (@DateSelect)"

And also what do you want to do by all codes in this procedure?

the small box will come out is becouse of this

Private Sub Student_Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

** If String.IsNullOrWhiteSpace(txtadmno.Text) Or String.IsNullOrWhiteSpace(txtcard.Text) Then
MessageBox.Show("Please complete the on the box.", "Authentication Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If**

This article has been dead for over six months. Start a new discussion instead.