Need help for a code

Hi all
Can any body varify following code. when i use this code, there is a msg occur that method is wrong.

If IsNumeric(Amount.text) Then
LoanAmount = Amount.text
Else
Msgbox "invalid Value"
endif

thanks in advance

Comments

  • : Hi all
    : Can any body varify following code. when i use this code, there is a msg occur that method is wrong.
    :
    : If IsNumeric(Amount.text) Then
    : LoanAmount = Amount.text
    : Else
    : Msgbox "invalid Value"
    : endif
    :
    : thanks in advance
    :
    :

    What is the exact error that is returned?

    Try this anyway

    [code]
    Dim LoanAmount As Integer

    If IsNumeric(Amount.text) Then
    LoanAmount = CInt(Amount.text)
    Else
    Msgbox "invalid Value"
    end If
    [/code]

    Regards,
    ______
    [size=2][b][blue]J[/blue]omac.[/b][/size]

  • : Hi all
    : Can any body varify following code. when i use this code, there is a msg occur that method is wrong.
    :
    : If IsNumeric(Amount.text) Then
    : LoanAmount = Amount.text
    : Else
    : Msgbox "invalid Value"
    : endif
    :
    : thanks in advance
    :
    :

    yea. You should convert the string value into numeric first.
    iddqd101
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories