I am trying to stop execution of an if statement so it doesn't reach the else statement. So, in my case, if the if statement is true then do not display the else statement and just ok the message box, Is that possible. Thanks
Dim sql As String
sql = "SELECT * FROM Departments where Customer = '" & customer & "'"
' This is our DataAdapter. This executes our SQL Statement above against the Database
' we defined in the Connection String
Dim adapter As New OleDbDataAdapter(sql, con1)
' Gets the records from the table and fills our adapter with those.
Dim dt As New DataTable("Departments")
If dt.Rows.Count = 0 Then
' Assigns our DataSource on the DataGridView
dgv1.DataSource = dt
Dim sql1 As String
sql1 = "SELECT * FROM Departments"
Dim adapter1 As New OleDbDataAdapter(sql1, con1)
Dim cmd1 As New OleDbCommand(sql1, con1)
'Dim dt1 As New DataTable("Departments")
Dim myreader As OleDbDataReader = cmd1.ExecuteReader