Qbert
Active member
i have a form that has a delete button on it. and when you click the delete button a message box pops up and asks you if you really want to delete it. but no matter what button you press (yes or no). it always acts as if you pressed no.
can anyone see a problem?
thanks
VB.NET:
If ClientListListBox.SelectedIndex = -1 Then
'do nothing
Else
PassedClientID = ClientIDArray(ClientListListBox.SelectedIndex)
PassedClientName = ClientNameArray(ClientListListBox.SelectedIndex)
MsgBox("Delete Client """ & PassedClientName & """?", MsgBoxStyle.YesNo)
If MsgBoxResult.No Then
MsgBox("Client """ & PassedClientName & """ was not deleted.", MsgBoxStyle.OkOnly)
ElseIf MsgBoxResult.Yes Then
IanConnect.Open()
Dim DeleteClient As New System.Data.OracleClient.OracleCommand
DeleteClient.Connection = IanConnect
DeleteClient.CommandText = "DELETE from CLIENTS where CLIENT_ID = " & PassedClientID
Delete = DeleteClient.ExecuteNonQuery()
If Delete > 0 Then
MsgBox("Client " & PassedClientName & " Deleted")
Me.Refresh()
Else
MsgBox("No")
End If
IanConnect.Close()
End If
End If
can anyone see a problem?
thanks