VB条件语句错误在哪里?
根据行李的不同重量计算运费,为什么输入字母的时候,仍然显示“免费”?Private Sub Command1_Click()
Dim a As Single, b As Single
a = Val(Text1.Text)
If 0< a <= 30 Then
Text2.Text = "免费"
ElseIf a > 50 Then
b = (a - 50) * 20 + (50 - 30) * 10
Text2.Text = b
ElseIf a > 30 And a <= 50 Then
b = (a - 30) * 10
Text2.Text = b
Else
Text2.Text = "输入错误"
End If
End Sub