Create a recordset named duplicateUser on the registration page. Set this to filter the Username column on the Username form element.
Then apply server Validation. use Numeric validation. for the Server variable enter:
$totalRows_duplicateUser
Set the minimum number to -1 and the maximum to 0.