DSUM strange error

danikuper

Registered User.
Local time
Yesterday, 20:32
Joined
Feb 6, 2003
Messages
147
I have a Dsum function in an event on a subform that reads:

Totals = DSum("[Paid_Amt]", "tblPayments", "[Custcode] = " & Me.CUSTCODE)

The problem is that when executed, I get the following error message:

Run-Time error '2471':
'The object doesn't contain the Automation object 'ABC."

(where ABC is [custcode] for the current record on screen).

I tried several things but none seems to work.

Any ideas of what is wrong??

thanks!
 
The Custcode, being text, needs to be enclosed in single quotes:-

Totals = DSum("[Paid_Amt]", "tblPayments", "[Custcode] = '" & Me.Custcode & "'")
 

Users who are viewing this thread

Back
Top Bottom