n00b... trying to display sum of query on form (1 Viewer)

belly0fdesire

Registered User.
Local time
Today, 12:01
Joined
Dec 1, 2005
Messages
11
Okay... I have a production database that my office uses... Users select a OrderType from the dropdown list and it appends it to a table with their username and the date... each product has a different point value... I have another table with the OrderTypes and their corresponding points... I want to display on the form a sum of all the points for the day. I created a query that pulls all the points for the current user for the current date, but I don't know how to display a sum of that query on the form...

I already have a count already displaying the number of orders completed by that user on that day, by using the module shown below... however that only involved a table and was simple... this one is more complicated because a query was used to retrieve the point value from another table.... hopefully this isn't too confusing... i'm really a beginner trying to learn what I need to know as I go.. can anyone help?

Code:
Public Function OrdersCount(ByVal UName As String, _
                            ByVal dat As Date) As Integer

    OrdersCount = DCount("[OrderNumber]", "Production", _
                  "[UserName] = '" & UName & _
                  "' AND [Date] = #" & dat & "#")
End Function
 

belly0fdesire

Registered User.
Local time
Today, 12:01
Joined
Dec 1, 2005
Messages
11
alright... i figured it out... was really easy... I just made a module with a DSum function referencing the query I created... the code i used is shown below...thank you if you at all considered helping me.



Code:
Public Function PointValue()

    PointValue = DSum("[Value]", "PointQuery")
End Function
 

Users who are viewing this thread

Top Bottom