Thanks for the reply, Ray,
I created the recordset, (rs_duplicated_fields) so that it will filter the DB table by two fields.
Then I created a WA server validation using the NUMBER rule. I set the validate field with $totalRows_rs_duplicated_fields and set the rule to minimum -1 and maximum to 0.
I moved the validation code under all my recordsets code and it seems to work now.