Inversion of accounts when a check is deposited

I am experiencing a problem when checks are deposited to my bank account. When I record an invoice the system credit sales and debits accounts receivable, which is correct. When I deposit a check accounts receivable is debited again and the bank is credited. The consequence is an accounts receivable account that never balances and a bank account that shows an increasing overdraft everytime a check is deposited.
Am I missing something in the accounting setup, or when I enter a check received?
Thanks
Willem