Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/06/2009, 15:56
Daviel
 
Fecha de Ingreso: octubre-2008
Mensajes: 44
Antigüedad: 15 años, 6 meses
Puntos: 1
Respuesta: Como puedo hacer esto sin ir campo a campo?

O tambien meter todos los TextBox en contenedor, por ejemplo, en un GroupBox y crear una función:
Function ValidarCtrl(ByVal Contenedor As GroupBox) As Boolean
Dim Ctrl As Control
For Each Ctrl In Contenedor.Controls
If Ctrl.Text = Nothing Then
MsgBox("Faltan Datos")
Ctrl.Focus()
ValidarCtrl = False
Exit Function
End If
Next Ctrl
ValidarCtrl = True
End Function
y en tu form:
If ValidarCtrl(TuContenedorGBox) = False Then Exit Sub