嗨伙计们,我在下一个代码遇到问题:
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
当我运行它时,出现一个错误说:Else without如果有什么想法我可以检查或更改?
感谢您的关注。
If IsNull(txtNumeroActa) Then
MsgBox "Ingresar Número de Acta"
Me.txtNumeroActa.SetFocus
ElseIf IsNull(txtNumeroActa) Then
MsgBox "Ingresar NIT"
Me.txtNumeroActa.SetFocus
ElseIf IsNull(txtNumeroActa) And IsNull(txtNumeroActa) Then
MsgBox "Ingresar Número de Acta y NIT"
Me.txtNumeroActa.SetFocus
Me.txtNumeroActa.SetFocus
End If