View Full Version : Barclays Bank Statements


forman
12-28-2007, 08:29 AM
Hi all

Barclays give me the feature of downloading my statements in csv format.

There are several fields, but the important being 'Amount'. I've imported into a table and added a 'debit' and 'Credit' field.

So far so good

When Barclay's data comes down debits are shown with a - (negative) before the amount.

What I'm trying to do is check the 'Amount' field, if it's a positive figure set the 'Credit' field to the same amount (which I've done) but, if it's a negative figure set the 'Debit' field to the same amount without the - (negative)

Here's what I've got so far :

Private Sub Negatives_Click()

If [Forms]![frm_Bank_Account]![Amount] > 0 Then
Forms![frm_Bank_Account]![Credit] = [Forms]![frm_Bank_Account]![Amount]

Else: Forms![frm_Bank_Account]![Debit] = [Forms]![frm_Bank_Account]![Amount] + [Forms]![frm_Bank_Account]![Amount]


End If
End Sub
Which just makes the negative number double the negative, not zero.

Any ideas please

Thanks

Alan

pbaldy
12-28-2007, 08:31 AM
Use the Abs() function.

forman
12-28-2007, 08:51 AM
Thanks Paul

Super-fast and spot on, it's working

Alan