MS Access Forum / Forms Programming / April 2008
Line Break
|
|
Thread rating:  |
DS - 25 Apr 2008 20:44 GMT I can't seem to break this into two lines...also is there a better, or shorter way to code this? Thanks DS
Me.TxtNone = Round(IIf(CDTaxCodeID = 2, Nz(DSum("(CDQuantity*CDFinalPrice)/(1+CDTaxRate)", "tblCheckDetailsTMP", "CDCheckID = " & Forms!Form2!TxtCheckID & " AND CDDiscountDP = 0 AND CDTaxCodeID = 2"), 0), _ Nz(DSum("CDQuantity*CDFinalPrice", "tblCheckDetailsTMP", "CDCheckID = " & Forms!Form2!TxtCheckID & " AND CDDiscountDP = 0 AND CDTaxCodeID <>2"), 0), 1))
Klatuu - 25 Apr 2008 21:02 GMT What do you mean, break it into two lines?
 Signature Dave Hargis, Microsoft Access MVP
> I can't seem to break this into two lines...also is there a better, or > shorter way to code this? [quoted text clipped - 9 lines] > 1)) > DS - 25 Apr 2008 22:51 GMT I want the code to be on two seperate lines. Thanks DS
Klatuu - 28 Apr 2008 14:39 GMT You have a line continuation character _ already in the code. Are you getting an error? Can you provide more detail, please?
 Signature Dave Hargis, Microsoft Access MVP
> I want the code to be on two seperate lines. > Thanks > DS DS - 28 Apr 2008 21:23 GMT A short version, Me.TxtField = DSum("Field","tblAll") + DSum("Field","tblSome")
This is too long so to view so I want to put the DSums on seperate lines.
Me.TxtField = DSum("Field","tblAll") + DSum("Field","tblSome")
How would I do this? Thanks DS
Klatuu - 28 Apr 2008 21:36 GMT Me.TxtField = DSum("Field","tblAll") _ + DSum("Field","tblSome")
But I still don't see the problem with the long version. As I said, you already have the line continuation character.
I can't very well help if you wont say what the problem is.
 Signature Dave Hargis, Microsoft Access MVP
> A short version, > Me.TxtField = DSum("Field","tblAll") + DSum("Field","tblSome") [quoted text clipped - 7 lines] > Thanks > DS DS - 28 Apr 2008 23:37 GMT The second line is in red.... Thank DS
Klatuu - 29 Apr 2008 14:29 GMT Syntax is incorrect. See if this works.
Me.TxtNone = Round(IIf(CDTaxCodeID = 2, Nz(DSum("CDQuantity*CDFinalPrice)/(1+CDTaxRate)", "tblCheckDetailsTMP", "CDCheckID = " & Forms!Form2!TxtCheckID & " AND CDDiscountDP = 0 AND CDTaxCodeID = 2"), 0), _ Nz(DSum("CDQuantity*CDFinalPrice", "tblCheckDetailsTMP", "CDCheckID = " & Forms!Form2!TxtCheckID & " AND CDDiscountDP = 0 AND CDTaxCodeID <>2"), 0), 1))
 Signature Dave Hargis, Microsoft Access MVP
> The second line is in red.... > Thank > DS DS - 30 Apr 2008 02:28 GMT DS - 30 Apr 2008 02:28 GMT Thanks Still In Red. DS
Klatuu - 30 Apr 2008 14:58 GMT Me.TxtNone = Round(IIf(CDTaxCodeID = 2, _ Nz(DSum("CDQuantity*CDFinalPrice)/(1+CDTaxRate)", "tblCheckDetailsTMP", _ "CDCheckID = " & Forms!Form2!TxtCheckID & _ " AND CDDiscountDP = 0 AND CDTaxCodeID = 2"), 0), _ Nz(DSum("CDQuantity*CDFinalPrice", "tblCheckDetailsTMP", "CDCheckID = " & _ Forms!Form2!TxtCheckID & " AND CDDiscountDP = 0 AND CDTaxCodeID <>2"), 0), 1))
 Signature Dave Hargis, Microsoft Access MVP
> Thanks > Still In Red. > DS
|
|
|