Find recs,count and take decision

aprentice

Registered User.
Local time
Today, 14:24
Joined
Aug 27, 2005
Messages
37
I want to find records upon some criteria and update or add according to the number of the records found.
I'm not asking how to build an add/update query, my main question is how to find the recs and take decision what to do upon their number.

I can't find any count upon criteria method

Tnx in advance
 
use the sql SELECT COUNT(*) AS result FROM table WHERE <criteria> to run a search and put the result into a recordset. Then use
rs.fields("result") in your statements as the number of records etc

so

If rs,fields("result") = 1 then
do something
Else
do something else
End If
 

Users who are viewing this thread

Back
Top Bottom