Welcome to VBForums

The problem is that a Recordset is not a simple data type which just has a single value, it is an Object variable (as shown by the use of Set) and therefore has multiple values (or Properties) and methods (such as .Open).

In order to get the value of a field from a recordset (even if there is only one), you need to specify the field. There are various ways to do that, but in this case I would recommend specifying by ordinal position (0 is the first field, 1 is the second, etc), eg:
Code:
IF RsDet.Fields(0).Value = 0 THEN
In other cases it is better to use the field name (but not apt here, as you aren't using a field directly), eg:
Code:
IF RsDet.Fields("Fieldname").Value = 0 THEN