lundi 3 septembre 2018

If In VBA Access

Hi guys i'm having trouble with the next code:

Private Sub btnRegistrar_Click()

If IsNull(txtNumeroActa) Then
    MsgBox "Ingresar Número de Acta"
    Me.txtNumeroActa.SetFocus
End If
ElseIf IsNull(txtNumeroActa) Then
    MsgBox "Ingresar NIT"
    Me.txtNumeroActa.SetFocus
End If
ElseIf IsNull(txtNumeroActa) And IsNull(txtNumeroActa) Then
    MsgBox "Ingresar Número de Acta y NIT"
    Me.txtNumeroActa.SetFocus
    Me.txtNumeroActa.SetFocus
End If

End Sub

When I run it, there appears an error saying: Else without If any ideas ofa what I can check or change?

Thanks for your attention.

Aucun commentaire:

Enregistrer un commentaire