Dim aa As Integer
        aa = 0
        Do While aa = 0            If TBxsbh.Text = Nothing Then
                MsgBox("请输入编号")
                TBxsxm.Focus()
            End If            If TBxsbh.Text <> Nothing And TBxsxm.Text = Nothing Then
                MsgBox("请输入姓名")
                TBxsxm.Focus()
            End If            If TBxsbh.Text <> Nothing And TBxsxm.Text <> Nothing And TBxsdw.Text = Nothing Then
                MsgBox("请输入单位")
                TBxsdw.Focus()            End If            If TBxsbh.Text <> Nothing And TBxsxm.Text <> Nothing And TBxsdw.Text <> Nothing And TBxsjj.Text = Nothing Then
                MsgBox("请输入简介")
                TBxsjj.Focus()
            Else
                aa = aa + 1
            End If        Loop
     MsgBox("ni")
只判断了第一个语句的直接执行else了.
导致数据只能输入第一个就不行了..
请高手指点

解决方案 »

  1.   

    你的意思应该是这样的吧?IF TBxsbh.Text=Nothing Then 
       MsgBox("请输入编号") 
       TBxsxm.Focus() 
    ELSE  IF TBxsxm.Text=Nothing Then 
             MsgBox("请输入姓名") 
             TBxsxm.Focus() 
          ELSE  IF TBxsdw.Text=Nothing Then 
                   MsgBox("请输入单位") 
                   TBxsdw.Focus() 
                ELSE  IF TBxsjj.Text=Nothing Then 
                         MsgBox("请输入简介") 
                         TBxsjj.Focus() 
                      ELSE aa=aa+1
                      ENDIF
                 ENDIF
          ENDIF
    ENDIF
    我也是初学者,但是以前有学过一点C,不知道这样写对不对,望大侠指点
               
      
      

  2.   


    Dim Done As BooleanDo Until Done
       If TBxsbh.Text = "" Then 
          MsgBox("请输入编号") 
          TBxsxm.Focus() 
       Else If TBxsxm.Text = "" Then 
          MsgBox("请输入姓名") 
          TBxsxm.Focus() 
       Else If TBxsdw.Text = "" Then 
          MsgBox("请输入单位") 
          TBxsdw.Focus() 
       Else If .Text = "" Then 
          MsgBox("请输入简介") 
          TBxsjj.Focus() 
       Else 
          Done = ((Len(TBxsbh) * Len(TBxsxm) * Len(TBxsdw) * Len(TBxsjj)) > 0)
       ENDIF
    Loop
      

  3.   

    哦,原来只需要一个ENDIF就行了的啊?
    我还以为每个IF都要END一次呢,见笑了