UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Dsum() Issues, Access 2016    
 
   
Jdk412
post Nov 18 2018, 02:59 PM
Post#1



Posts: 17
Joined: 16-July 18



Hi,

I am trying to use dsum() to compile a total quantity of shipped quantity

I have a single table with a primary key of Shop Order # (Example: 30267)

when we partially ship a Job I create a New record with a P# assigned to the Shop Order # (Example: 30267P1) So i may have multiple partials to a single job so i would keep numbering the partial (P1, P2 , P3)
which all will have a shipped quantities assigned to them

CODE
Me.Shipped_Quantity = DSum([Shipped Quantity], "Open Shop Orders", "[Shop Order #] Like '*" & "[" & Me.Shop_Order__ & "]" & "*'")


This is my code to do the Dsum() Which will add all the quantities shipped and assign it to the original Shop Order # (30267) But it only returns 0?

Thanks,



Go to the top of the page
 
RJD
post Nov 18 2018, 03:18 PM
Post#2


UtterAccess VIP
Posts: 9,244
Joined: 25-October 10
From: Gulf South USA


Hi: Try something like this ...

DSum("[Shipped Quantity]", "[Open Shop Orders]", "[Shop Order #] Like '*" & Me.Shop_Order & "*'")

Some points ... I took the underlines off the end of Me.Shop_Order (not a good naming idea since you can't always tell how many you have), enclose the domain in square brackets since it has spaces in the name, enclose the field in quotes, since that is the requirement, leave off the additional square brackets around the Me.Shop_Order, since that just confuses Access as to what you are looking for.

Also, I would do a couple other things: Take the spaces out of the object names (leads to errors when not properly enclosed in square brackets), do not use # in an object name (this relates to dates in many cases).

See if this works better for you. I tested it and seems to work as required.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
Jdk412
post Nov 18 2018, 03:37 PM
Post#3



Posts: 17
Joined: 16-July 18



Works perfectly! yayhandclap.gif

Yeah im new to this access game..... Coming from CNC Programming i had a project of coding A full blown ERP system thrown on me a few months ago, so im basically winging it HAH.

As ive always said "Fake it till you make it".

Thank you for the advice i will see to correcting the naming style i choose (I've been having an inclining to do that and i definitely see how it can get out of hand)

Go to the top of the page
 
RJD
post Nov 18 2018, 03:59 PM
Post#4


UtterAccess VIP
Posts: 9,244
Joined: 25-October 10
From: Gulf South USA


You are very welcome. Glad that worked for you. thumbup.gif

QUOTE
...coding a full blown ERP system thrown on me a few months ago...

BIG project. I have a client that I have built/rebuilt/configured what is, overall, an ERP system. NOT a trivial project, and it will test your skills in many areas. We developed this piece-by-piece, bringing components up in stages, over an extended period, as they learned how they wanted to operate. Bring it up, stress test under real usage, adjust, bring up the next component, etc.

The client had hired someone to "eat the elephant in one big bite" starting with a full-up CRM+ in Access and the system was slow, incomplete, constantly crashed and was frustrating to all users, and hurt the business - leading to the developer walking away. So I took over, cleared up the crash and inefficiency issues and started implementing it in stages, then tying in other components (most I built) to get an essentially full ERP system.

The moral that I am trying to put forth is try to do this in stages, especially if you are doing this alone. But I imagine you already appreciate all this ...

Regards and good luck with your project ...

Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    18th December 2018 - 06:44 AM