Solved

A new DSum question

Posted on 2012-04-12
10
217 Views
Last Modified: 2012-04-12
What is wrong with...

Me.txtFormsRkfd = DSum("[NumForms]", "tblPrintOrdTranx", "[DateEntered] between #" & Me.txtStart & "# AND #" & Me.txtEnd & "#", "[ProdPlant] = "'"CompanyName"'")

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37839687
Again,

What did *you* try first to fix this?

Dis you follow the basic troubleshooting I outlined for you in your previous post?

You really should not just simply post your formulas and ask us to "Fix" them for you.
0
 

Author Comment

by:SteveL13
ID: 37839697
I've tried changing the single quotes and double quotes and can't resolve the issue.  The previous question today did not have the...

"[ProdPlant] = "'"CompanyName"'"

part in the code.

--Steve
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 37839710
Well, the DSUM() function only accepts 3 parameters, and when you added the last part, you made it the 4th parameter by separating it from the rest by a comma.  Instead of doing that, you need to append that new criteria on to the end of the previously working criteria.
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:SteveL13
ID: 37839724
I'm sorry but I don't know what that means or how to do it.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37839798
Your new criteria looks good for prod plant.  Try separating it from the rest using AND instead of a comma.
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 500 total points
ID: 37839803
Is CompanyName a variable, or do you just want to insert the name of the company inside single quotes?

Me.txtFormsRkfd = DSum("[NumForms]", "tblPrintOrdTranx", "[DateEntered] between #" & Me.txtStart & "# AND #" & Me.txtEnd & "# AND [ProdPlant] = 'CompanyName'")

or maybe

Me.txtFormsRkfd = DSum("[NumForms]", "tblPrintOrdTranx", "[DateEntered] between #" & Me.txtStart & "# AND #" & Me.txtEnd & "# AND [ProdPlant] = " & chr$(34) & strCompanyName & chr$(34))
0
 

Author Comment

by:SteveL13
ID: 37839834
This worked...

Me.txtFormsRkfd = DSum("[NumForms]", "tblPrintOrdTranx", "[DateEntered] between #" & Me.txtStart & "# AND #" & Me.txtEnd & "# AND [ProdPlant] = 'CompanyName'")

Thanks.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37839897
<The previous question today did not have the...
"[ProdPlant] = "'"CompanyName"'"
part in the code.>
Yes, but the sequential steps for troubleshooting are still the same...

Remember you simple said here:
 "What is wrong with..."
You did not stated what you tried
You did not state what errors you got.
You did not state what "CompanyName" was...

<I'm sorry but I don't know what that means or how to do it.>
Dsum (like all aggregate functions) is fairly well documented in the help files.
...and on the web too:
http://www.techonthenet.com/access/functions/domain/dsum.php

Just an FYI...

JeffCoachman
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37840494
Jeff,

To his credit, Steve *showed* what he tried (even though he didnt explicitly state it) and he came pretty close to getting it right independently.  That is the style he generally uses, and I think the questions can be read as "this is what I have tried ... what did I miss?".
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37840718
<To his credit, Steve *showed* what he tried (even though he didnt explicitly state it)>
Point taken

My point was that the original post just stated:
   "What is wrong with..."
There was no mention of:
what *else* was tried
what errors
what "CompanyName" was
What the expression was trying to do...
The part of the expression that was working (from the previous Q)

We all like helping Steve out, and he unusually posts good solid questions, ...but to me, this particular Q was a bit "thin" on those details.
;-)

I know that every once in a while a member will just be in a crunch and just need help ASAP...
;-)

Jeff
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question