SteveL13
asked on
Getting an error on another DSUm
=Nz(DSum("Qty","tblWarehou seTransTra nx","PartN = " & Chr(34) & [txtPartN] & Chr(34) & " And WarehouseID = 'AT'"),0)
Can someone help?
Can someone help?
ASKER
That did not work.
Most likely:
[txtPartN]
should be:
Me.[txtPartN]
but without some context, it's hard to say what your problem is.
Jim.
[txtPartN]
should be:
Me.[txtPartN]
but without some context, it's hard to say what your problem is.
Jim.
Nz(DSum("Qty", "tblWarehouseTransTranx", "PartN = " & Chr(34) & Me.txtPartN & Chr(34) & " And WarehouseID = " & Chr(34) & "AT" & Chr(34)), 0)
IF PartN is numeric then
Nz(DSum("Qty", "tblWarehouseTransTranx", "PartN = " & Me.txtPartN & " And WarehouseID = " & Chr(34) & "AT" & Chr(34)), 0)
Nz(DSum("Qty", "tblWarehouseTransTranx", "PartN = " & Me.txtPartN & " And WarehouseID = " & Chr(34) & "AT" & Chr(34)), 0)
or better yet:
Nz(DSum("[Qty]","tblWareho
Jim.
and BTW, warehouse ID is a text field right?
Jim.
@JD ... < what was the link where you asked what the Top 10 questions that are asked in EE ?>
thx.mx
ASKER
So far nothing works and WarehouseID is a text field. I'm putting this in the control source of the field so I don't need the Me.
Have you tried using single quotes instead of double quotes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And what exactly is(are) the error you are getting ?
ASKER
#Error
Then some table or field name is likely misspelled ...
They syntax is correct ... something else is going on.
mx
They syntax is correct ... something else is going on.
mx
Or, using the function I provided this morning;
=Nz(DSum("Qty","tblWarehou seTransTra nx","PartN = " & fnWrap([txtPartN]) & " And WarehouseID = " & fnWrap("AT")),0)
The syntax you accepted from mbizUp earlier this morning was:
= NZ(DSum("Qty", "tblForecastImports", "PartN = " & CHR(34) & [txtPartN] & CHR(34) & " And Planned = FALSE And WarehouseID = 'AM'"),0)
So modifying this should have been pretty easy. When you said "that did not work", what did you mean, to whom were you replying. It would be helpful, if when you respond to one of us, you indicate who you are replying to, and even include the ID # of the post, so we know who and what you are replying to.
Where is the control that you are using this as the controlsource for? Is it in the same section of the report as the txtPartN field?
=Nz(DSum("Qty","tblWarehou
The syntax you accepted from mbizUp earlier this morning was:
= NZ(DSum("Qty", "tblForecastImports", "PartN = " & CHR(34) & [txtPartN] & CHR(34) & " And Planned = FALSE And WarehouseID = 'AM'"),0)
So modifying this should have been pretty easy. When you said "that did not work", what did you mean, to whom were you replying. It would be helpful, if when you respond to one of us, you indicate who you are replying to, and even include the ID # of the post, so we know who and what you are replying to.
Where is the control that you are using this as the controlsource for? Is it in the same section of the report as the txtPartN field?
Is txtPartN (No?) a control on a form or a field?
If it's a control and this is in a form try using Me.txtPartN.Value instead of [txtPartN].
If it's a control and this is in a form try using Me.txtPartN.Value instead of [txtPartN].
For a control source property, your syntax looks good.
Like mx said, Check the table and field names. Also test it in the Query Builder to make sure it runs.
Also double-check your control source for an extra = sign at the beginning. I think Access 2007 throws those in automatically - which may cause problems if you copy/paste control sources (eg from EE questions)
Like mx said, Check the table and field names. Also test it in the Query Builder to make sure it runs.
SUM(Qty)
FROM tblWarehouseTransTranx
WHERE PartN = 'place your actua lPN here' And WarehouseID = 'AT'
Also double-check your control source for an extra = sign at the beginning. I think Access 2007 throws those in automatically - which may cause problems if you copy/paste control sources (eg from EE questions)
=Nz(DSum("Qty","tblWarehou
mx