DCount

  • Thread starter Thread starter Jani
  • Start date Start date
J

Jani

I need to delete certain records from a temp table. In the field [Open] if
there is an N, the record should be deleted; if a Y, then the record remains
in the temp table. I have something wrong in my condition but can't figure
out what. If I run the queries separately, they work. Can anyone help me?
Thanks so much! Jani

1st row in the macro turns off the warning
2nd row - has the condition below and a msg box that says 'no records have
been closed'
DCount("*","tbl_SelectPMTasks","[Open]<>0")>0
3rd row cancels the above event if no records have an N in Open field (...
in condition column, Cancel Event in Action column )
4th row is a query that moves records from the temp table to a permanent
table IF there is an N in the Open field
5th row is a query that deletes the records from the temp table IF there is
an N in the Open field.
6th row turns the warning messages back on.
 
I think your DCount needs to be this, assuming that Open field is a text
datatype field:

DCount("*","tbl_SelectPMTasks","[Open]<>'N'")>0
 
Hi Ken - Got it. Thanks for your help!

Ken Snell MVP said:
I think your DCount needs to be this, assuming that Open field is a text
datatype field:

DCount("*","tbl_SelectPMTasks","[Open]<>'N'")>0


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Jani said:
I need to delete certain records from a temp table. In the field [Open] if
there is an N, the record should be deleted; if a Y, then the record
remains
in the temp table. I have something wrong in my condition but can't figure
out what. If I run the queries separately, they work. Can anyone help me?
Thanks so much! Jani

1st row in the macro turns off the warning
2nd row - has the condition below and a msg box that says 'no records have
been closed'
DCount("*","tbl_SelectPMTasks","[Open]<>0")>0
3rd row cancels the above event if no records have an N in Open field (...
in condition column, Cancel Event in Action column )
4th row is a query that moves records from the temp table to a permanent
table IF there is an N in the Open field
5th row is a query that deletes the records from the temp table IF there
is
an N in the Open field.
6th row turns the warning messages back on.
 
Back
Top