试试  if  trim(txtEmpFirstName.Text) =""
在字符串比较时,尽量的使用 Trim(string )
 

解决方案 »

  1.   

    在满足条件时,End if 前应退出子程序,"exit sub"、"goto"等等.如:
            If txtEmpLastName.Text = "" Then
                Utility.AddToMsg strMsg, "You must enter a last name."
                txtEmpLastName.SetFocus
    Exit Sub
            End If
            If txtEmpFirstName.Text = "" Then
                Utility.AddToMsg strMsg, "You must enter a first name."
                txtEmpFirstName.SetFocus
    Exit Sub
            End If
      

  2.   

    是不是你的数据库中规定一定要输入lastname
      

  3.   

    你的程序中肯定有,在一定条件下要求输入lastname