It really doens't matter which "form" the data is displayed. This expression is all about the tables and fields. The only requirement is that Text117 is on the same form as the text box.
Today's date is Date()
=DSum("[TimeSpent]","tblTaskDetails","[TaskUpdateDate] =#" & Date() & "#")+Nz([Text117],0)
BTW: "Text117"? Kick it up a notch. Every significant control deserves a decent name ;-)
Duane Hookom
MS Access MVP
To: MS_Access_Professionals@yahoogroups.com
From: luvmymelody@yahoo.com
Date: Fri, 29 Jul 2011 22:52:11 +0000
Subject: [MS_AccessPros] DSum question
Hello,
I have a form with a text box with the below expression. This expression used to work, but it seems that something has changed on it.
I am trying to get the totals of today's task hours from the main form and the subform. For some reason I can only see totals for dates that do not happen on today. So the expression works but not for today's date.
TimeSpent is on the main form
TaskUpdateDate is on the subform from the table tblTaskDetails.
Text117 is on the main form
I started with this expression but realized if there is a null there would be 0. So I tweaked the expression to the one below.
=nz(DSum("[TimeSpent]","tblTaskDetails","[TaskUpdateDate] = [Date]")+[Text117],0)
If anyone sees the problem I would appreciate the help
Thank you
Jim Wagner
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)
<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Tidak ada komentar:
Posting Komentar