Error executing delete query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I created a simple delete query which runs fine.

DELETE *
FROM Employees
WHERE Last_Name Like Forms!List_Employees!Last_Name;

I know it's not idea. I'm going to go back and use the employee_ID once I've
ironed out the bugs.

The problem is when I try to have the query execute as the result of a
button click. The Wizard wouldn't let me chose that query to execute and when
I selected a differerent query and changed the name in the "on click" sub I
got this error: A Problem occured while Master_Inventory was communicating
with the OLE Server or Active X Control.

Help please!
 
Hi,
Try changing the SQL to this:

" DELETE * FROM Employees WHERE Last_Name " & _
"Like '" & Forms!List_Employees!Last_Name & "';"

If you're not using wildcards you may as well use the "=" operator, there's
no value in the "Like".

HTH -Linda
 
Back
Top