请看以下代码,我想在text1失去焦点是做校检,当不合条件时,单击命令按钮command1时则不能执行相关代码,但当执行text2.setfocus后,下面的令行不被执行,请问怎么解决?dim a as boolean
Private Sub Command1_Click()
Text2.SetFocus
Debug.Print "eeeeeeee"
debug.print a
if a=true then exit sub
......
......End SubPrivate Sub Text1_LostFocus()
If IsNumeric(Text1.Text) = False Then
a=true
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
Text2.SetFocus
Debug.Print "eeeeeeee"
debug.print a
if a=true then exit sub
......
......End SubPrivate Sub Text1_LostFocus()
If IsNumeric(Text1.Text) = False Then
a=true
Text1.SetFocus
End If
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货