Full Version: Learning About Some Code Report
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
mkkashif
Dear Sir.

Please Read the following Code and can some tell me .
CRFlag Mean i guess this is field.
CRFlag=True Mean i don't know .
CDFlag i think this a Field in the Query.is this a field in table.
Can somone tell me about this two little Question.


confused.gif confused.gif confused.gif
Code and Explanation

So to do what you are trying to do, you would use DSum to calculate the Beginning Balance by summing iif([CRFlag]=True, TransactionAmount, -TransactionAmount) where date < Your ReportBeginDate

For the debit and credit fields, you use a query containing TransactionTypeID, TransactionAmount and CDFlag. In two textboxes on your report.....For the Credit, you use the expression =iif([CRFlag]=True,[TransactionAmount],Null) and for the Credit, you use the expression =iif([CRFlag]=False, [TransactionAmount],Null)
For the Running balance, I'd calculate =[BeginningBalance=+iif([CRFlag]=True,[TransactionAmount],-TransactionAmount]


confused.gif confused.gif confused.gif
yvesdekort
Hi,

CRFlag is probably a field in a table (to be 100% sure, I need a bit more background an the db)
It probably is a boolean-type, this means it is either true or false.

So for the expression Credit = Iif([CRFlag]=True,[TransactionAmount],Null)
the value of CRFlag is compared to true,
so if CRFlag holds the value true, the Credit = TransactionAmount;
if CRFlag holds the value false, the Credit = Null

The CDFlag could be a typo (it probably should also be CRFlag), because it isn't mentioned afterwards; but again to be 100% sure, one would need a little more background.

hth
mkkashif
Thanks Dear Sir.

it's mean that there must be a field in the table with type YES/NO.
And it has Name CrFlag.and when do entries there we decide True/False.
Am i Right.confused.gifconfused.gifconfused.gif
Can You See this .in Background this is the Thread.
Please See this Link
yvesdekort
I attached a small sample db that shows you how to get started.
mkkashif
Thanks very Much for your example
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.