Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2006

Tip: Looking for answers? Try searching our database.

Calculating Opening Balance in a Report !

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Prakash - 08 Feb 2006 20:15 GMT
I have 2 tables ...

Customer_Master: Cust-Code, Cust_Name

Customer_Transactions: Cust_Code, Date, Details, Debit, Credit

I would like to generate a report in the foll manner, say from 15.1.06
to 15.02.06 :

Customer Code: 999-9876543
Customer Name: abc-xyx-abc

Date        Details                                      Debit
Credit
======= =====================  ========  ========
              Op.Bal as at 15.1.06                        0.00
78.94

15.1.06     Transaction 1
16.1.06     Transaction 2
upto
15.2.06     Transaction Last

               Cl.Bal as at 15.2.06              ========  ========

Could someone please tell me how to go about generating this.

Should I use a query or use the table itself as the record source of
the report ?

Most importantly ... how to generate the OPENING BALANCE ?  This really
beats me !

Thx & Best Rgds,
Prakash.
salad - 08 Feb 2006 22:13 GMT
> I have 2 tables ...
>
[quoted text clipped - 31 lines]
> Thx & Best Rgds,
> Prakash.

You can use a table or query.  Whatever floats your boat.  Oftentimes
people use queries since data may come from several tables to make up a
"report" record.

When you open the report, you can filter it.
    Dim datFrom As Date
    Dim datTo As Date
    'i don't use international dates.  I use mm/dd/yyyy, you can
    'test for yourself
    datFrom = #15.1.06#
    datTo = #15.02.06#
   
    Docmd.OpenReport "MyReport",,,"TXDate Between #" & _
        datFrom & "# And #" & datTo & "#"
This will filter your report to only show records in the time frame.

Usually a report is called from a form.  Let's say the form is called
RptForm and you have a from/to date field.  For your opening balance you
can use DSum()
    =Dsum("Debit","table","TXDate < #" & Forms!RptForm!FromDate & "#") -
Dsum("Credit","table","TXDate < #" & Forms!RptForm!FromDate & "#")

This subtracts the credits from debits for all records in the table less
than the from date in the report form. So create a field to display the
balance and use the above Dsum() statement as your control source...with
modifications to meet your criteria.

These are simply concepts.  Hopefully you can adjust to suit your needs.
Prakash - 09 Feb 2006 11:01 GMT
Thx !  I'll certainly give it a bash & get back to you on the result.
Sounds easy enough ... if i have any further queries I'll post them.

Best Rgds,
Prakash.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.