Delete Record Problems

GregSmith

Registered User.
Local time
Today, 14:51
Joined
Feb 22, 2002
Messages
126
I am trying to delete a record from a table called employees.
Inside my form, I have a drop down that is linked to the table.
When you select an employee in the drop down and click the delete key, it delete's the top record and not the one selected.

Any idea's??

Here is my code:

DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.GoToRecord , , acNext
Me.Refresh
DoCmd.SetWarnings True
 
Probably because you are not going to the record in the combo box just be selecting it - you are deleting the current record on the form's recordset.
 
I ended up using the docmd.runsql delete command.
Does what I need.

Thanks for the reply.
 
If you built the SQL in code then I'd suggest making a query to do it and open the query in code to reduce database bloat.
 

Users who are viewing this thread

Back
Top Bottom