
09/06/2009, 15:56
|
| | Fecha de Ingreso: octubre-2008
Mensajes: 44
Antigüedad: 16 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 |