DSUM Not Working

D

DS

This DSum isn't working....SalesID is a Text field and SDTaxed is a
Yes/No field.

SDTaxed is on the Subform with this control.

Thanks
DS

=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID]=" &
[Forms]![Sales]![SalesID] & " AND [SDTaxed]=True"),0)
 
D

DS

DS said:
This DSum isn't working....SalesID is a Text field and SDTaxed is a
Yes/No field.

SDTaxed is on the Subform with this control.

Thanks
DS

=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID]=" &
[Forms]![Sales]![SalesID] & " AND [SDTaxed]=True"),0)

Now at least I get a zero! But still not working!
HELP!!! I want to go home!
Thanks
DS

=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID
& "' AND [SDTaxed] = '" & True & "'"),0)
 
D

Duane Hookom

=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID &
"' AND [SDTaxed] = " & True ),0)
If the True is always True, why don't you use
=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID &
"' AND [SDTaxed] = -1" ),0)

--
Duane Hookom
MS Access MVP


DS said:
DS said:
This DSum isn't working....SalesID is a Text field and SDTaxed is a
Yes/No field.

SDTaxed is on the Subform with this control.

Thanks
DS

=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID]=" &
[Forms]![Sales]![SalesID] & " AND [SDTaxed]=True"),0)

Now at least I get a zero! But still not working!
HELP!!! I want to go home!
Thanks
DS

=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID &
"' AND [SDTaxed] = '" & True & "'"),0)
 
D

DS

Duane said:
=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID &
"' AND [SDTaxed] = " & True ),0)
If the True is always True, why don't you use
=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID &
"' AND [SDTaxed] = -1" ),0)
Bless You. I can go home now! That works just fine....Just one more
quick question though. How do I get the form from showing the action?
I have Echo set to False on the code that runs but I can still see the
action. Once again THANK YOU!!!!!!!!!!!!!
DS

Private Sub ListBar_Click()
DoCmd.Echo False, ""
DoCmd.GoToControl "SalesDetails"
DoCmd.GoToRecord , , acNewRec
Forms!Sales.SalesDetails!LineID = _
Nz(DMax("[LineID]", "SalesDetails"), 0) + 1
Me![SalesDetails]![ItemID] = Me.ListBar.Column(0)
Forms!Sales.SalesDetails!MenuNum = Forms!Sales!Text65
Forms!Sales.SalesDetails!SDTaxed = Forms!Sales.SalesDetails!Taxed
Forms!Sales.SalesDetails!SDInclusive =
Forms!Sales.SalesDetails!Inclusive
Forms!Sales.SalesDetails!SDNoTax = Forms!Sales.SalesDetails!NoTax
Forms!Sales.SalesDetails.Form.Requery
With Forms!Sales.SalesDetails.Form.Recordset
If Forms![Sales].[SalesDetails].Form!Text115 > 0 Then
.MoveFirst
Do While .EOF = False And .BOF = False
.Edit
!SDInclusive = False
!SDTaxed = True
If Forms!Sales.SalesDetails.Form!NoTax = True Then
!SDTaxed = False
!SDInclusive = False
End If
.Update
.MoveNext
Loop
End If
End With
DoCmd.GoToRecord , , acLast
DoCmd.Echo True, ""
End Sub
 
D

Duane Hookom

Beats me. You should feel free to start a new thread with a new question.

--
Duane Hookom
MS Access MVP


DS said:
Duane said:
=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID
& "' AND [SDTaxed] = " & True ),0)
If the True is always True, why don't you use
=Nz(DSum("[Expr1]","SalesDetailsQ","[SalesID] = '" & Forms!Sales!SalesID
& "' AND [SDTaxed] = -1" ),0)
Bless You. I can go home now! That works just fine....Just one more
quick question though. How do I get the form from showing the action? I
have Echo set to False on the code that runs but I can still see the
action. Once again THANK YOU!!!!!!!!!!!!!
DS

Private Sub ListBar_Click()
DoCmd.Echo False, ""
DoCmd.GoToControl "SalesDetails"
DoCmd.GoToRecord , , acNewRec
Forms!Sales.SalesDetails!LineID = _
Nz(DMax("[LineID]", "SalesDetails"), 0) + 1
Me![SalesDetails]![ItemID] = Me.ListBar.Column(0)
Forms!Sales.SalesDetails!MenuNum = Forms!Sales!Text65
Forms!Sales.SalesDetails!SDTaxed = Forms!Sales.SalesDetails!Taxed
Forms!Sales.SalesDetails!SDInclusive =
Forms!Sales.SalesDetails!Inclusive
Forms!Sales.SalesDetails!SDNoTax = Forms!Sales.SalesDetails!NoTax
Forms!Sales.SalesDetails.Form.Requery
With Forms!Sales.SalesDetails.Form.Recordset
If Forms![Sales].[SalesDetails].Form!Text115 > 0 Then
.MoveFirst
Do While .EOF = False And .BOF = False
.Edit
!SDInclusive = False
!SDTaxed = True
If Forms!Sales.SalesDetails.Form!NoTax = True Then
!SDTaxed = False
!SDInclusive = False
End If
.Update
.MoveNext
Loop
End If
End With
DoCmd.GoToRecord , , acLast
DoCmd.Echo True, ""
End Sub
 
D

DS

Duane said:
Beats me. You should feel free to start a new thread with a new question.
Thanks, I appreciate your help. This only took 16hrs to accomplish!
And now I can't Stop!!!
Once again.
Thank You
DS
 

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

DLookUp Trouble 3
DLookUp Problem 7
DSum Problem 4
DSum Problem 2
A Better Way 4
Convert to SQL 4
Not Aligning 2
Nested IF 7

Top