When recordcount is -1 you must be using ADO.
you should use count(*) query to count the records.
if count=0 then
do something
else if
do some thing
end if

thanks
karun