please kindly help me!!!
what i wanted is when i select items in the combobox and it is already in the database it will prompt that it is already in the database..tnx
Private Sub ComboBox3_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ComboBox3.Validating
If ComboBox3.Validating Then
con = New OleDbConnection("Provider= Microsoft.ACE.oledb.12.0; Data Source=C:\Users\edenzam\Desktop\CBFMNHS Enrollment System\CBFMNHS Enrollment System\bin\Debug\Enrollment System.accdb")
Dim ewaaa As String = "Select * from SchedulingTwos where YearLevels = '" & ComboBox1.Text & "'"
com = New OleDbCommand(ewaaa, con)
con.Open()
com.ExecuteNonQuery()
rid = com.ExecuteReader
rid.Read()
If (rid.HasRows) Then
ComboBox3.Text = rid(2)
MsgBox("Section Already Exist", MsgBoxStyle.Critical, "Error")
ComboBox3.SelectedIndex = -1
End If
End If
End Sub