sql - Access delete query not deleting right record -
this should not hard. i'm trying delete record table, id equal form value. done thousand times.
in case, first record in table being deleted, not selected 1 in form. i've looked @ table properties, form properties , tried every delete query variation i'm aware of.
i've tried building delete query in query design , executing that. i've tried sql statement passing access query. , i've tried writing sql access delete query. results same. however, if hard code id number in access delete query, correct record deletes expected. here's few i've tried:
set dbs = currentdb docmd.runsql "delete * " _ & "tblcourse cocourseid = " & cocourseid & ";" set dbs = currentdb dbs.execute "delete * " _ & "tblcourse cocourseid = " & cocourseid & ";" currentdb.querydefs("dqrydeletecourse").sql = "delete * tblcourse cocourseid = " & cocourseid & ";" dbs.execute dqrydeletecourse
in cases, variable populating correctly.
here's query design of dqry (this not work): field: cocourseid table: tblcourse delete: criteria: [forms]![frmcourseedit]![cocourseid]
(i use method of criteria = form object value throughout application without issue)
when criteria = 1003 (hardcoded), works.
any troubleshooting ideas appreciated.
Comments
Post a Comment