Error when selecting general ledger account

SOLVED

I am constantly getting this error when I am processing a cash book or an invoice. When I try to choose/pick a general ledger account that error pops up. Can someone assit how I can resolve the error. I have even restored a working backup but the error is still coming up. What could be the cause of this