what I am trying to do is when the delete button is pressed on my binding navigator strip it gives the user the option to cancel the deletion of the entered client data from my database by using the code below.
Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click
Dim answer As Object
answer = MessageBox.Show("Are you sure you want to delete the client data", "Exit", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
If answer = MsgBoxResult.Cancel = True Then
Return
End If
End Sub
When the delete button is pressed the mesagebox shows. Then if the cancel button is pressed on the messagebox it still deletes the current record which is not what its supposed to do.
I have checked the output to the answer variable and it does indeed contain CANCEL so im not sure why its not working.
Using VB express 2008 with SQL express
Anybody got any suggestions

New Topic/Question
Reply



MultiQuote




|