Como podria optimizar este codigo, tomando en cuenta que puedo tener mas texbox los cuales no necesariamente son obligatorios y pueden quedar en blanco.
If Text2 = "" Then
MsgBox "El campo nombre es obligatorio", vbCritical, "Datos incompletos"
Exit Sub
ElseIf txtPrecio = "0.00" Or txtPrecio = "0,00" Or txtPrecio = "" Then
MsgBox "El campo Precio es obligatorio", vbCritical, "Datos incompletos"
Exit Sub
ElseIf Text3 = "" Then
MsgBox "El campo descrip. corta es obligatorio", vbCritical, "Datos incompletos"
Exit Sub
ElseIf Text4 = "" Then
MsgBox "El campo stock es obligatorio", vbCritical, "Datos incompletos"
Exit Sub
ElseIf Text5 = "" Then
MsgBox "El campo categoria es obligatorio", vbCritical, "Datos incompletos"
Exit Sub
ElseIf Text6 = "" Then
MsgBox "El campo doc es obligatorio", vbCritical, "Datos incompletos"
Exit Sub
Else
'--INSERT--
End If