John, you are a genius! I put in your code, and it summed correctly for the
creditID! I knew I had a syntax error in my dsum statement, but couldn't
figure out what it was. Your breaking it down using strCrit as the variable
worked.
THANK YOU so much. I REALLY appreciate your time in helping me with this.
"John W. Vinson" wrote:
> On Mon, 13 Apr 2009 17:11:02 -0700, laavista
> <(E-Mail Removed)> wrote:
>
> >I should have included this info in my question.
> >
> >I'm getting the error "syntax error (missing operator) in query expression
> >'[creditsid]=",
> >
> >Field "CreditsUsed": integer
> >"CreditsID" is an autonumbered field (long integer)
> >
> >The value of longintCredits_CreditsID = 2 and I can "find" the record
> >
> >Thanks for looking at this.
>
> That suggests that the variable isn't defined. Try doing some debugging:
>
> Dim strCrit As String
> strCrit = "[creditsID] = " & longintCredits_CreditsID
> intCreditsUsed = Nz(DSum("[CreditsUsed]", "t_creditsused", strCrit))
>
> Put a breakpoint on the intCreditsUsed = line, run the code, and see if
> strCrit is in fact being set correctly. At what point is
> longintCredits_CreditID being set, and for that matter dimensioned?
> --
>
> John W. Vinson [MVP]
>
|