Code Help Please

thebigman

Registered User.
Local time
Today, 09:11
Joined
Sep 3, 2009
Messages
45
Wonder if someone could help. Im using Office 2010 and trying to get this to work but so far no joy. I,m using it in a text box.
Thanks for any help. Keep getting #error
=DSum("Amount","Ledger","Account='Running Costs'")
 
Code:
=DSum("Amount","Ledger","Account='Running Costs'")

Looks fine to me. Are you using Table lookups for that field?
 
Your syntax looks fine. It should work even if you have null values.
#Error means Access cannot find one or more of the referenced items. Check your field spellings are correct.
 
Spelling looks OK. I just made a form called trial balance and inserted a text box and used this code. Ledger is table Account field and Amount is money. Running Costs are categories.
 
I had 1 spelling mistake so now I have a blank box.
 
I did not see any obvious spelling error?
 
maybe, rename your textbox to something else.
 
Double checked and all spelling is OK. Checked field types and renamed text box. Now blank box.
 
Created a new box with same code but blank box. Strange.
 
So upload enough of the db to get the issue.
You have not answered about lookup fields either?
 
Upload database to forum.?
Just enough of it to get the issue.
Compact and repair, zip and upload if quite large, which really it should not be for this is issue.
 
does Account field has lookups?
 
see form1, you have lookup on account field, returning a numeric String.
 

Attachments

Users who are viewing this thread

Back
Top Bottom