Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation help 1

Status
Not open for further replies.

DrillMonkey

Technical User
Joined
Sep 29, 2006
Messages
64
Location
US
Hi forum,

I have a form called Brookhurst on this form I have (2) controls; the first control is named Packages, and the other is named Total. I want the Packages control to be summed and displayed into the Total control based on this criteria >=date(). After midnight this returns to null. I have a query already set to this >=date() but I think I need some (SQL) code to accomplish this.

Thanks,
Richard
 


Richard,

WHAT are you talking about???

YOU know what's in your head.

Unfortunately, my crystal ball is foggy today.

"... I have a query already set to this >=date() ..."

Well, it might be somewhat helpful if we could have a peek.

"I want the Packages control to be summed "

What kind of a control? What are the values associated with the control?

"...displayed into the Total control based on this criteria >=date()."

what is criteria? Usually a CRITERIA is some OPERATOR, so in general terms...
[tt]
value1 criteria value2
[/tt]
like
Code:
xtxMyDate.Value >= Date()
But again, that exression means absolutely nothing outside the context of your query, which you seem to be hiding under a bushel

Skip,

[glasses] [red][/red]
[tongue]
 
Lets forget the select query I mentioned I apolgize for that. The user needs to see the total packages before he prints the report. And I am able to do that, heres my problem what happens when the user opens the form tomorrow?
It will continue to Calculate yesterdays totals which will be incorrect. I need the control to be "null" at the start of a new day.
 



Why won't that work?
[tt]
Yourdate = Date()
[/tt]




Skip,

[glasses] [red][/red]
[tongue]
 
It might, I just don't know how... I've tried to get my select query to that but, I'm an Access rookie 4 months of experience.
 
easy Skip! . . . EASY! . . .

I'm sure you've been here before! . . .

[blue]Remember when you were learning?[/blue] . . .

Calvin.gif
See Ya! . . . . . .
 
Howdy DrillMonkey . . .

Taking over this thread from another respected tipster is not my intent . . . I'm sure [blue]Skip[/blue] is already in tune with the demeanor of my previous post (I'll monitor just incase).

Make way for his [blue]prowess![/blue] . . .

[blue]Skip![/blue] . . . your pickup! . . .

Calvin.gif
See Ya! . . . . . .
 
I can get my form to Calculate, I just can't figure out how to make stop Calculating ...as in start over? thats why I wanted to use this >=date() in my date field of my query...am I wrong or off base? I use this in my Totals control
=Sum([packages]) on my form
 
Have a look at the DSum function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Another way, provided the RecordSource contains the date field:
=Sum(IIf([date field]>=Date(),[packages],0))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks to all who replied to this thread. I was able to acomplish what I need with
Code:
=DSum("packages","BrookhurstQuery")
 
Code:
=DSum("packages","BrookhurstQuery")[code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top