Hi Guys, I'm having quite a nasty little problem with deleting a row from a table. I have the user selecting the name of an employee from a DataCombo Box and then they push the delete button, to delete the record. Of course this should also update the combo box. One nasty little problem is that it will put a number as one entry in the combo box. Then it also gives me a slew of different errors on deleting a record. Below is my code. What am I doing wrong!!! Thanks in advance for the help.
On Error Resume Next
DataEnvironment1.rsEmployees.Filter = "UserName = '" & cmbEmp.Text & "'"
DataEnvironment1.rsEmployees.Delete
If Err.Number <> 0 Then
Debug.Print "Problem" & Err.Description
DataEnvironment1.rsEmployees.CancelUpdate
End If
On Error GoTo 0
-Mike
On Error Resume Next
DataEnvironment1.rsEmployees.Filter = "UserName = '" & cmbEmp.Text & "'"
DataEnvironment1.rsEmployees.Delete
If Err.Number <> 0 Then
Debug.Print "Problem" & Err.Description
DataEnvironment1.rsEmployees.CancelUpdate
End If
On Error GoTo 0
-Mike