Solved

A new DSum question

Posted on 2012-04-12
10
216 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 (Access MVP)
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 (Access MVP) 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

710 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