Hey there,
thanks, but I guess this works if the values are stored in different fields only?? the content in my textfield appears exactly as mentioned above:
Fieldname: CountryDetails
Content: EU=6;CH=3;CN=2
complete with '=' and ';'
I have played around with deleting the country and '=' sign to give the following result:
Fieldname: CountryDetails
Content: 6;3;2
Would this be easier to get a sum total of?
This file has been passed over to me from my predecessor...for the moment I have to work with what I've got :-( and make the changes to the structure, etc. later...
Ok, so you need a function for this. Place this in a module:
Code:
Public Function AddValues(strField As Variant) As Long
Dim splitVals As Variant, i As Integer
If Not IsNull(strField) Then
splitVals = Split(strField, ";")
For i = LBound(splitVals) To UBound(splitVals)
AddValues = AddValues + Val(splitVals(i))
Next
End If
End Function