Results 1 to 4 of 4
  1. #1
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55

    Data from three tables

    Hi there.
    i have data from three tables namely: sales,expenditure & Purchases.
    At the end of the day i want to balance and see how much money remains after all the three. how do i join these in a report as sales,expenditure,purchases and then balance. can someone upload an example for me?
    1.Sales has Date,product,Amt
    2.Expenditure has Date,Expense,Amt


    3. Purchases has Paytdate,Product Name,Amtpaid
    Fred

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    use DSum:

    This can be done in a query as calculative field. Form Controls can be used as reference to make the Date criteria Dynamic.

    the following expressions can also be used in the control source of unbound text boxes in a report.

    Example:
    TotalSales: Dsum("[Amt]","Sales","[Date]=#07/21/2010#")
    TotalExpenditure: Dsum("[Amt]","Expenditure","[Date]=#07/21/2010#")
    TotalPurchase: DSum("[Amtpaid]","Purchases","[PayDate]=#07/21/2010#")
    Balance:TotalSales-(TotalExpenditure+TotalPurchase)

    the following expressions can also be used in the control source of unbound text boxes in a report as
    =Dsum("[Amt]","Sales","[Date]=#07/21/2010#") = TextBox1
    =Dsum("[Amt]","Expenditure","[Date]=#07/21/2010#")=TextBox2
    =DSum("[Amtpaid]","Purchases","[PayDate]=#07/21/2010#")=TextBox3

    each in the control source of each unbound textBox
    TextBox1-(TextBox2+TextBox3)

    Note: text highlighted in red is not a part of the expression and is given to indicate which text box the expression is used.

  3. #3
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55
    Thanks Maximus.
    it has worked.
    is there some code i code use to bring details of the same transactions such that i get a detailed report on sales,expenditure,purchases and balance in one query form or report?
    Thanks
    Fred

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    you need to use Subforms or SubReports.

    please mark this thread solved as I feel your original problem is solved.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pulling only certain data from tables.
    By stevman22889 in forum Access
    Replies: 2
    Last Post: 07-15-2010, 06:23 PM
  2. Mail Merge w/ data from 2 tables
    By sedain121 in forum Import/Export Data
    Replies: 3
    Last Post: 06-30-2010, 09:43 AM
  3. Data from muliple tables
    By carstenhdk in forum Queries
    Replies: 3
    Last Post: 06-08-2010, 10:35 AM
  4. Data Sharing within Tables?
    By clai in forum Database Design
    Replies: 1
    Last Post: 11-06-2009, 06:32 PM
  5. Need to replicate data in 2 tables
    By magister011 in forum Access
    Replies: 5
    Last Post: 11-02-2009, 04:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums