Solved

DSum question

Posted on 2012-04-12
3
287 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
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
Comment Utility
Steve,

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

Expert Comment

by:Helen_Feddema
Comment Utility
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
Comment Utility
<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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now