簡體   English   中英

如果在VBA中

[英]If In VBA Access

嗨,大家好,我在下一個代碼上遇到了麻煩:

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

當我運行它時,會出現一條錯誤消息:其他如果我對我可以檢查或更改的內容有任何想法?

感謝您的關注。

刪除結束條件。 這里這里看看語法

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM