Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Deletions

Status
Not open for further replies.

slugo

Programmer
Dec 16, 2001
15
US
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 &quot;Problem&quot; & Err.Description
DataEnvironment1.rsEmployees.CancelUpdate
End If
On Error GoTo 0

-Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top