Podes validar el formulario activo de la siguiente manera:
Código vb:
Ver originalPublic Sub validaCampos()
Dim i As Integer
On Error Resume Next
For i = 0 To Screen.ActiveForm.Controls.Count - 1
If TypeOf Screen.ActiveForm.Controls(i) Is TextBox Then
If Not Len(Screen.ActiveForm.Controls(i).Text) > 0 Then
Screen.ActiveForm.Controls(i).SetFocus
MsgBox "Debe ingresar un dato en este campo", vbExclamation
End If
' ElseIf TypeOf Screen.ActiveForm.Controls(i) Is ComboBox Then
' ElseIf TypeOf Screen.ActiveForm.Controls(i) Is CheckBox Then
' ElseIf TypeOf Screen.ActiveForm.Controls(i) Is OptionButton Then
End If
Next i
End Sub