Average data in a field and print it out in another (1 Viewer)

rscott1989

Registered User.
Local time
Today, 11:21
Joined
Oct 24, 2013
Messages
21
I am trying take all the data from one field "TOTAL" and Average it out and print it in one of my forms. I would also want this data to update automatically as the totals are updated. I am attaching some screen shots of what I am talking about

The first pic is the totals field that i want to have averaged up. The second pic is where I want it to be printed out.

Any ideas???

Thanks so much!!
 

Attachments

  • totals.jpg
    totals.jpg
    101.1 KB · Views: 108
  • print out.jpg
    print out.jpg
    97.6 KB · Views: 116

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:21
Joined
Feb 19, 2002
Messages
43,196
The table you posted isn't normalized. It is probably the view used for reporting and hopefully, the underlying data is normalized. In Excel where sheets have both width and length, tables have only length so there are no functions that will aggregate "across" columns. All aggregation is done on sets of data and that equates to rows.
 

rscott1989

Registered User.
Local time
Today, 11:21
Joined
Oct 24, 2013
Messages
21
Ok now how do i move the data from my new query to the display on the form i want it to?
 

AlexHedley

Registered User.
Local time
Today, 11:21
Joined
Aug 28, 2012
Messages
171
You can either set the source of the Form to be the Query that has the values in or use a DLOOKUP to display it on the Form.
 

rscott1989

Registered User.
Local time
Today, 11:21
Joined
Oct 24, 2013
Messages
21
I have tried the Dlookup, I keep getting errors. maybe im not doing it right

AvgOfTOTAL is my field name
TOTALQRY is my query name
Table1 is my table name

I want to print the number given in the "AvgOfTOTAL" field in the text box on my form.

I appreciate your patience, as i am still quiet new to this! :D
 

Attachments

  • sreenshot.jpg
    sreenshot.jpg
    94.9 KB · Views: 94
  • screenshot 2.jpg
    screenshot 2.jpg
    101.2 KB · Views: 95

AlexHedley

Registered User.
Local time
Today, 11:21
Joined
Aug 28, 2012
Messages
171
You just need the Field and the Query name:
Set the textbox to be

=DLOOKUP ("Field", "Query")
=DLOOKUP ("AvgOfTOTAL", "TOTALQRY")


A few DLOOKUP examples:

http://www.599cd.com/tips/access/dlookup-function/?key=AlexForum

=DLOOKUP (Field, Domain, Criteria)

=DLOOKUP ("LastName", "CustomerT", "CustomerID=5")

=DLOOKUP ("Address", "CustomerT", "CustomerID=" & CustomerCombo)

http://www.599cd.com/tips/access/130724-dlookup-no-programming/?key=AlexForum

http://www.599cd.com/tips/access/130921-copy-last-record/?key=AlexForum

This is explained more in depth in Access Expert 10
Course:
http://www.599cd.com/site/courselist/access2013/expert/x10/?key=AlexForum
 

Users who are viewing this thread

Top Bottom