详细是这样的:Private Sub Command1_Click()
Dim x As Single
Dim y As Single
x = Text1.Text
If Option1.Value = True Then
If x <= 3 Then y = 10
If x > 3 And x <= 10 Then y = 10 + (x - 3) * 2
If x > 10 Then y = 10 + 7 * 2 + (x - 10) * 3
Text2.Text = y
End If
End Sub
If Option1.Value = True Then这句倒是没有什么错,但以下这句确是应该算错了
x = Text1.Text
因为X是Single类型的,所以上句应该改一下,如下句:
x = Val(Text1.Text)
x = Text1.Text
因为X是Single类型的,所以上句应该改一下,如下句:
x = Val(Text1.Text)
温馨提示:答案为网友推荐,仅供参考
第1个回答 2012-07-03
报得什么错。
第2个回答 2012-07-03
什么问题都没有呀,挺好的,写的
第3个回答 2012-07-03
Option1.Value = 1
第4个回答 2012-07-03
不规范