DCount

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.
 
K

Ken Snell MVP

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

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

Jani

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top