I haven't done a lot of data type converting so please bear with me. I'm grabbing data from a field that's formatted for currency (2 decimal places) and assigning it a variable. I then run an if statement against it, but I'm getting a conversion error. Here is my code:

Dim CapAmount as String 

    If CapAmount >= 3000 Then
        'Do stuff
    End If

When I type 3000.00 into the editor it removes the last 0 and changes it to a double.If I remove the (.) it changes it to an integer. So should I be casting to a double or decimal to get the right type? I'm doing this in Infopath's code editor if that makes a difference. Any help is appreciated! Thanks.

Here is the error message:
Conversion from string "" to type 'Integer' is not valid.at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)

5 Years
Discussion Span
Last Post by Ghoztrider
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.