Importing negative number formats

G

Guest

When I download my reports from SAP I save them in 'unconverted' format and
the negative values get a minus at the end (100,00-). Acces cannot recognise
them as numbers so they don't get imported.
Any solution how to convert them?
 
D

Douglas J. Steele

Import them as text, then write a function that converts the values
accordingly.

Something along the lines of the following untest air code should work:

Function ConvertValue(ValueIn As String) As Currency

Dim booNegative As Boolean
Dim strTemp As String

If Right(ValueIn, 1) = "-" Then
strTemp = Left(ValueIn, Len(ValueIn) - 1)
booNegative = True
Else
strTemp = ValueIn
booNegative = False
End If

If IsNumeric(strTemp) = True Then
If booNegative = True Then
ConvertValue = CCur(strTemp) * -1.0
Else
ConvertValue = CCur(strTemp)
End If
Else
ConvertValue = 0.00
End If


End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top