Private Sub text1_LostFocus()End Sub

解决方案 »

  1.   

    很容易啊!使用Text的validate事件,你就可以捕获这种情况,然后可以实现你的要求。 查看MSDN中的validate时间说明。 其中有一段代码就是针对Text框的。good luck .
      

  2.   

    if trim(text1)="" then  'text1为空
        msgbox "text1不能为空,请输入内容"
        text1.setfocus
        exit sub  '强制退出该过程
     else
       ......
     end if
      

  3.   

    Private Sub text1_LostFocus()
        if text1.text = "" then
            msgbox "输入不能为空!"
            text1.setfocus
            exit sub
        end if
    End Sub
      

  4.   

    在你的程序中加入下面的代码:If Text1.text="" Then
        Msgbox ""
        Text1.Setfocus
        Exit Sub  '或者是exit function
    End If
      

  5.   

    Private Sub Text1_DataChange()
        if text1.text = "" then
            msgbox "输入不能为空!"
            exit sub
        end if
    End Sub
    加上
    Private Sub text1_LostFocus()
        if text1.text = "" then
            msgbox "输入不能为空!"
            text1.setfocus
            exit sub
        end if
    End Sub
    这样错误的几率会降低
      

  6.   

    很简单啊,如下:Private Sub text1_LostFocus()
        if text1.text = "" then
            msgbox "错误,输入不能为空!"
            text1.setfocus
            end if
    End Sub
      

  7.   

    If Trim(Text1.Text)="" then 
        MsgBox "不能为空,请输入内容"
        Text1.SetFocus
        Exit sub  '退出过程
     Else
       ......
    End If