?
Solved

DSum question

Posted on 2012-04-12
3
Medium Priority
?
336 Views
Last Modified: 2012-04-12
Can someone tell me what is wrong with this?

me.txtPrint =DSum("[Qty]","tblSalesOrdTranx","[DateEntered] between me.txtStart and me.txtEnd)

--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 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 37838522
Steve,

me.txtPrint =DSum("[Qty]","tblSalesOrdTranx","[DateEntered] between #" & me.txtStart & "# AND #" & me.txtEnd & "#")
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 37838680
It is a good idea to check for valid dates in the controls, and (if they contain valid dates) save the values to Date variables, for use in the expression.  Here is some sample code:

   If IsDate(Me![txtDate].Value) = True Then
      dteSingle = CDate(Me![txtDate].Value)
   End If

Open in new window

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37838780
<No Points wanted>

Does this work?
=DSum("[Qty]","tblSalesOrdTranx")
if not STOP and fix it...then proceed.
Does this work:
DSum("[Qty]","tblSalesOrdTranx","[DateEntered] =" & me.txtStart )
If not then STOP and fix it...then proceed.
Does this work:
DSum("[Qty]","tblSalesOrdTranx","[DateEntered]=" & 3/15/2012 )

..ect

In other words your formula should not have gotten that complex ("Between") before you discovered something was wrong...

Most syntax errors are easy to spot (as your was), ...However, it is interesting that you did not post what *You* tried first to resolve this...
   ("Experts, I tried this, this and that, and some other thing, and none of them worked"
;-)
Sound fair?

JeffCoachman
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

765 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