VB中判断txt输入的数据是否为空,为空则不参与下步的计算
PrivateSubCommand3_Click()a=Val(Text1.Text)b=Val(Text2.Text)c=Val(Text3.Text)d=Val(Te...
Private Sub Command3_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text4.Text)
e = Val(Text5.Text)
f = Val(Text6.Text)
jssx = ""
If a <= 0.6 And b <= 120 And c >= 610 And d <= 1500 And e <= 15 And f <= 5 Then
jssx = jssx & "加宽加厚"
End If
end sub
如题,text中我可能不输入数据,这样的对应的参数在下面判断时,不参与判断,只要满足其他的判断条件就可以,请问高手怎么破? 展开
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text4.Text)
e = Val(Text5.Text)
f = Val(Text6.Text)
jssx = ""
If a <= 0.6 And b <= 120 And c >= 610 And d <= 1500 And e <= 15 And f <= 5 Then
jssx = jssx & "加宽加厚"
End If
end sub
如题,text中我可能不输入数据,这样的对应的参数在下面判断时,不参与判断,只要满足其他的判断条件就可以,请问高手怎么破? 展开
1个回答
展开全部
可以这样处理:
Private Sub Command3_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text4.Text)
e = Val(Text5.Text)
f = Val(Text6.Text)
jssx = ""
If (Trim(a)="" Or a <= 0.6) And (Trim(b)="" Or b <= 120) And (Trim(c)="" Or c >= 610) And (Trim(d)="" Or d <= 1500) And (Trim(e)="" Or e <= 15) And (Trim(f)="" Or f <= 5) Then
jssx = jssx & "加宽加厚"
End If
end sub
Private Sub Command3_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text4.Text)
e = Val(Text5.Text)
f = Val(Text6.Text)
jssx = ""
If (Trim(a)="" Or a <= 0.6) And (Trim(b)="" Or b <= 120) And (Trim(c)="" Or c >= 610) And (Trim(d)="" Or d <= 1500) And (Trim(e)="" Or e <= 15) And (Trim(f)="" Or f <= 5) Then
jssx = jssx & "加宽加厚"
End If
end sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询