急!!!!!vb的问题

来源:百度知道 编辑:UC知道 时间:2024/06/29 21:11:31
在vb中,有textbox1(对应新设备的数值)和textbox2(对应旧设备的数值),我想通过对他们两个中的数据进行比较,用COMMAND按纽,写了Private Sub CommandButton1_Click()
If TextBox22 > TextBox23 Then
MsgBox "使用新设备"

If TextBox22 < TextBox23 Then
MsgBox "使用旧设备"
End If
End If

End Sub
可为何在运行时,有的时候可以显示出结果,有的时候按了后,没有反映
在线等,半小时

如果TextBox22 > TextBox23 时怎么还会同时有
TextBox22 < TextBox23 呢?
我改了下,你试试
-----------------------
Private Sub CommandButton1_Click()
If TextBox22 > TextBox23 Then
MsgBox "使用新设备"

elseIf TextBox22 < TextBox23 Then
MsgBox "使用旧设备"

End If

End Sub