none
VBA to DSUM RRS feed

  • Question

  • I need help with VBA to DSUM but with Multiple critiria....actually 3

    in table1

    If Feild1 = QQ1

    If Feild2 = "Name1"

    If Feild3 = CC102

    SUM Field4

     

    Thanks alot in advance for helping.

     


    Pedie
    Tuesday, August 2, 2011 9:15 PM

Answers

  • Got this from HELP

    Thanks everyone....

    [code]

    Option Compare Database
    Option Explicit

    Sub test()
    Dim LTotal As Currency
    LTotal = DSum("Exps", "Table1", "CC_N = 1009")

    MsgBox LTotal

    End Sub
    Sub itest2()
    Dim curX As Currency
    curX = DSum("[Exps]", "Table1", "[CC_N] = 1009")

    MsgBox curX
    End Sub
    Sub iest2()
    Dim curX As Currency
    curX = DSum("[Exps]", "Table1", _
        "[CC_N] = 1009 AND [QT_1234] = 'Q1'")
    MsgBox curX
    End Sub

    [/code]


    Pedie
    • Marked as answer by Pedie Nz Tuesday, August 2, 2011 9:35 PM
    Tuesday, August 2, 2011 9:35 PM