Only issue is when the if statement catches a letter is sends the message box but it continues to tell me a string can not be converted to double. This worked fine until I added the ElseIf to make it look and work better.
Added statements where my issue is.
'Setting a numbers only catch.
If IsNumeric(AmountBox1.Text) = False Then
'Amount must be numeric. Please enter a valid loan amount.
MsgBox("Ok, no letters or characters, just use numbers! Please enter a valid amount between 1 and 10,000.")
'tried an and here but get a syntax error.
And terminate program
'Setting a lessthan 1 catch.
ElseIf AmountBox1.Text <= 0 Then
'Amount must be above 1.
MsgBox("Please use amounts no lower than 1")
'Setting a greaterthan 10000 catch.
ElseIf AmountBox1.Text >= 10001 Then
'Amount must be below 10000.
MsgBox("Please use amounts no higher than 10000")
End If
'Here is the catch the error: Conversion from string "any letter within the 'amount" to type double. I understand what it is saying but do not know how to 'stop it from going to this line. Need it to stop at the if statement.
Amount = AmountBox1.Text
This post has been edited by FinFin: 07 February 2012 - 11:14 PM

New Topic/Question
Reply



MultiQuote







|