Solved

Total

Posted on 2006-11-09
7
266 Views
Last Modified: 2012-06-22
Hi,

I have two tables name tblAMKCC71 and tblAMKCGP:  

In tblAMKCC71 fields are: overnight, dayshift, eveningshift
In tblAMKCGP fields are: overnigh, dayshift, eveningshift

There is a third table  name tblrptPharmacy
In tblrptPharmacy field is: generatedOrders

I want to total tblAMKCC71 and tblAMKCGP fields together and put in tblrptPharmacy field name generatedOrders.

How do i go about doing this.

I know to create a query but i know how to sum single field but not the multiple fields of different table.

I am very beginner programmer in access.  Help greatly appreciated.
0
Comment
Question by:sikan71
  • 4
  • 3
7 Comments
 
LVL 44

Expert Comment

by:GRayL
ID: 17908431
How does the Pharmacy table relate to the two AMK tables?  What field is common among the  three?
0
 

Author Comment

by:sikan71
ID: 17909117
There is no relationship:  i am trying to put all the totals in table tblrptPharmacy.  So that i can create a report on monthly basis.  I have 10 tables for each building at my work,  the data get entered on daily basis.  But i have created query which pulls the data of previous month and does the sum for each field of each table. for example, Now say i have the sum of each field in the tblAMKC71 and also tblAMKCGP.  I want to add together certain fields of tblAMKCC71 and tblAMKCGP and put it in different table tblrptPharmacy and call the field name generatedOrders. Hope this is clear.
0
 
LVL 44

Expert Comment

by:GRayL
ID: 17909290
Well, here's literally what you asked for:

INSERT INTO tblrptPharmacy (GeneratedOrders) Select Sum(overnight+dayshift+eveningshift) from tblAMKCC71;
INSERT INTO tblrptPharmacy (GeneratedOrders) Select Sum(overnight+dayshift+eveningshift) from tblAMKGCP;

0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:sikan71
ID: 17909405
Instead of running a query with insert can i directly use this values in the report.
My problem is since my database has 10 tables(each for different building).  My report needs to use all 10 tables to get the values i need from each field.  As far as i know you can use only single recordsource.  How can i achieve this.  As i mentioned previously very new to access

My report setup:

Building:                ARDC     AMKC        GMDC   ............                                   Total


Type of Orders
# Of Formulary
# Of Nonformulary
Total Orders


# Of Orders
Keep
Detox
Total Orders


So i have it set up like this.

Say for building AMKC:  I need to put the totaled value i mentioned above in the # Of Formulary.  Is it possible to sum here instead of writing separate query.


0
 
LVL 44

Accepted Solution

by:
GRayL earned 125 total points
ID: 17909761
You can use a domain aggregrate function as the control source for a textbox tbxAMKCC71:

=DSum("overnight+dayshift+eveningshift","tblAMKCC71")

then for tbxAMKGCP

=DSum("overnight+dayshift+eveningshift","tblAMKGCP")

and so on.  Does this help?

0
 

Author Comment

by:sikan71
ID: 17909943
Is it possible to combine both tables field values into one since I want AMKCC71 and AMKCGP into the tbxAMKC  There is no tbxAMKCC71 and tbxAMKCGP.  
0
 
LVL 44

Expert Comment

by:GRayL
ID: 17939545
tbxAMKC control source.

=DSum("overnight+dayshift+eveningshift","tblAMKCC71") + DSum("overnight+dayshift+eveningshift","tblAMKGCP")

Thanks, glad I could help.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
View vs Edit mode enhancements 12 40
Library not Registered 16 50
Run Time Error 3071 26 39
format date field on certain entries 8 29
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

895 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

15 Experts available now in Live!

Get 1:1 Help Now