A former bank cashier has been jailed after stealing £40,000 from people’s accounts to buy a house and fund his drug and gambling habits.

Joshua Hull, of Blenheim Road, Ramsey, was working for Barclays when he committed the fraud between May 2011 and November 2012.

The 24-year-old appeared at Peterborough Crown Court last Thursday and admitted four counts of fraud by abuse of position.

Prosecuting, Cheryl Williams said Hull had worked for Barclays since 2010, mainly in Ramsey and Huntingdon.

An internal audit had revealed Hull had accessed his own account using his log-in code, contrary to company policy. He had also used colleagues' pass codes and was suspended in November.

Meanwhile, the bank received a report from a branch in Cardigan, West Wales, about an account held by 90-year-old Roland Gill.

Three accounts belonging to Mr Gill, holding a total of more than £30,000, had been emptied by Hull, who changed address details and the frequency of statements to cover his fraud, said Miss Williams. Hull also withdrew £10,000 from an account belonging to an 89-year-old man.

"The timing suggests it was in c­onnection with the defendant buying his house," she said.

The total loss to the account holders was £40,099.15. Both victims had been repaid by the bank, the court was told.

"He told police he had spent the money on taxis, rent, deposit for the house and furniture and equipment for the house," said Miss Williams.

"He said his drug habit had cost £70 to £80 a week, he had made a loan to a friend for £3,000 to £4,000, was gambling up to £100 a week, had credit card debts of £6,000 to £7,000, and had paid £500 to £600 to Ramsey Golf Club.

"He told police there was no money left."

Having told his girlfriend he had savings and could afford the lifestyle he wanted them to have, there was a danger his lie would be exposed so he took the money, said Miss Williams.

David Povall, in mitigation, said Hull's actions had been entirely out of character. He said: "He has asked me to say how sorry he is for the victims and wishes it to be stressed that he did not target them maliciously. He targeted accounts with large amounts of money in."

Mr Povall said Hull had not wanted to let down his girlfriend, had got into debt and was suffering from depression.

He had taken to gambling to try to use winnings to put some of the money back. "The more he gambled, the more he lost. He was hoping to be caught because he did not know how to stop."

Judge Nic Madge said he had received five references, one describing Hull as respectful, polite and well-mannered and a fine upstanding member of the community.

But he said the fraud had been ­committed over 18 months in 11 transactions and many more account operations to conceal what he had done.

Judge Madge, who sentenced Hull to 16 months in prison for each offence, to be served concurrently, said: "Fraud by people in a position of trust is easy to commit. Society expects absolute honesty from bank employees.

"You have let many people down and let yourself down."