Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is wrong with this dsum code

Status
Not open for further replies.

RBE

Programmer
May 25, 2000
72
US
This is giving me a syntax error of "Missing Operand" I have tryed putting an = sign inside the ( out side the ( removing the outer() and using a varible all come back with various syntax errors.

this is on an access report
<code>
Private Sub Report_Activate()
Do Until (DSum(&quot;Gallons Received&quot;, &quot;qryDGLRPT&quot;, &quot;product code=product code&quot;)) <= (Forms![frmDGLRPT]![GALLONS1])
Loop
End Sub
</code>
 
I'm intrigued by the &quot;productcode=productcode&quot; statement in the DSum argument list, is DSum an intrinsic sub?

you might try putting your () around that statement. The compiler may be getting confused on which operator is the one that the do loop should analyze (i.e. do until productcode = productcode, or do until DSum <= Forms![...])

good luck!
 
Try:
Code:
Private Sub Report_Activate()
Do Until (DSum(&quot;Gallons Received&quot;, &quot;qryDGLRPT&quot;, &quot;product code = &quot; & [product code]) <= Forms![frmDGLRPT]![GALLONS1])
Loop
Rob Marriott
rob@career-connections.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top