Accounts Receivable must be written off when it becomes certain that the accounts receivable cannot be collected. The debit balance applies to the bad debt expenses and the credit balance applies to the related accounts receivable. Or alternatively, before the allowance is recorded the debit balance applies to the allowance for doubtful account while the credit balance applies to the related accounts receivable.