如果不是不同类型的控件,可以使用控件数组如果是不同类型的,可以使用控件的tag,每个需要校验的,定义tag属性为1dim ctl as controlfor each ctl in me.controls
   if ctl.tag="1" then
      if lenb(trim(ctl.text))=0 then
         debug.print ctl.name & "空了"
      else
      endif
   else
   endif
next手工写的,请自行测试

解决方案 »

  1.   

    把TextBox的Index设为一系列值,使之成为数组,然后
    dim ttt as TextBoxfor each ttt in text1
       if trim(ttt.Text)<>"" and not isnull(ttt.text) then
       
       end if
    next
      

  2.   

    你只要把这些text全都命名成一样的名称,然后根据index的不同写循环语句实现!
    Dim i As Integer
        For i = 0 To 50
            If Text1(i).Text = "" Then MsgBox Index & "为空!"
        End If
      

  3.   

    for  each  ctl  in  me.controls  
    请问这句话是什么意思,
    马上给各位仁兄的分
      

  4.   

    for  each  ctl  in  me.controls  
    遍历窗体中的所有控件