DSum Syntax

D

DS

I have a DSum that is giving me problems. It says wrong synatx. Any
suggestions welcome.
Thanks
DS

Me.TxtRefAmount = Nz(DSum("PayAppliedAmount", "tblPayApplied",
"PayAppliedCheckID = " & Forms!frmFXRefunds!TxtCheckID & " And
PayAppliedNameID = " & Forms!frmFXRefundItems!TxtNameID & " And
PayAppliedAmount < 0 And PayAppliedTime = #" &
Forms!frmFXRefundItems!TxtTime & "#), 0)
 
D

DS

Now it's saying Type Mismatch....I think I'm getting closer...
DS

Me.TxtRefAmount = Nz(DSum("PayAppliedAmount", "tblPayApplied",
"PayAppliedCheckID = " & Forms!frmFXRefunds!TxtCheckID & "" _
And "PayAppliedNameID = " & Forms!frmFXRefundItems!TxtNameID & " And
PayAppliedTime = #" & Forms!frmFXRefundItems!TxtTime & "# And
PayAppliedAmount <0"), 0)
 
P

Piet Linden

Now it's saying Type Mismatch....I think I'm getting closer...
DS

Me.TxtRefAmount = Nz(DSum("PayAppliedAmount", "tblPayApplied",
"PayAppliedCheckID = " & Forms!frmFXRefunds!TxtCheckID & "" _
    And "PayAppliedNameID = " & Forms!frmFXRefundItems!TxtNameID & " And
PayAppliedTime = #" & Forms!frmFXRefundItems!TxtTime & "# And
PayAppliedAmount <0"), 0)

I removed a few of the excess double quotes...
Me.TxtRefAmount = Nz(DSum("PayAppliedAmount", "tblPayApplied",
"PayAppliedCheckID = " & Forms!frmFXRefunds!TxtCheckID & " _
And [PayAppliedNameID] =" & Forms!frmFXRefundItems!TxtNameID & "
And
PayAppliedTime = #" & Forms!frmFXRefundItems!TxtTime & "# And
PayAppliedAmount <0"), 0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Is This OK? 3
Not Null In Query 2
Line Break 9
Using INT() 5
DSum Problem 2
Error on Empty Table 3
Function Returns 0 3
DSum Problem 4

Top