Importing negative number formats

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
Back
Top