ms access fix textbox #Erro

I had this question after viewing Import XML File Into Access Table Using VBA???.
Hi everyone,
I need help,
  I have one textbox and I use one function  =Nz(DSum("[Total]","Total_Customer_Qarz","[Customer_ID] = " & [Customer_ID]),0)
so when having records it's showing me correct but when have no record will give to me #ERROR!
adamdaban dabanStudentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
when there is no record,  [Customer_ID] will not have a value --> substitute nz([Customer_ID],-99) where -99 is some value you do not have in your table

I see you do have NZ wrapped around the whole thing ... but that is not helping when there is no value in the control
adamdaban dabanStudentAuthor Commented:
sorry I'm not understanding your solution
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:

=DSum("[Total]","Total_Customer_Qarz", "[Customer_ID] = " & NZ([Customer_ID],0) )

I simply moved the NZ function

NZ is Null-to-Zero and returns 0, "", or whatever is in the optional second argument if the first argument does not have a value

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
adamdaban dabanStudentAuthor Commented:
Thanks it's work
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
you're welcome ~ happy to help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.