Print data in different control depending upon data in field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I have a table which holds debits and credits of petty cash payments. I have
a field called TransType which identifies if it is a credit or a debit and an
Amount field which stores the petty cash amount. On my report is it possible
to split the amount between two columns under the headings of debit and
credit like below:

eg

Date TransType Credit Debit
01/11/05 Credit 200
02/11/05 Debit -100
03/11/05 Debit -50
04/11/05 Credit 500

I've tried putting an If statement in the On format or On Print event of the
detail section, with unbound controls and setting values in code and also
with using the Visible property but I can't get it to work :-(

Can this be done if so can anyone help please?
Thanks
Sue
 
hughess7 said:
I have a table which holds debits and credits of petty cash payments. I have
a field called TransType which identifies if it is a credit or a debit and an
Amount field which stores the petty cash amount. On my report is it possible
to split the amount between two columns under the headings of debit and
credit like below:

eg

Date TransType Credit Debit
01/11/05 Credit 200
02/11/05 Debit -100
03/11/05 Debit -50
04/11/05 Credit 500

I've tried putting an If statement in the On format or On Print event of the
detail section, with unbound controls and setting values in code and also
with using the Visible property but I can't get it to work :-(



One way is to use an expression in the credit and debit text
boxes:
Credit =Iff(TransType = "Credit", Amount, Null)
Debit =Iff(TransType = "Debit", Amount, Null)
 
Thanks Marshall - worked a treat!

Sue

Marshall Barton said:
One way is to use an expression in the credit and debit text
boxes:
Credit =Iff(TransType = "Credit", Amount, Null)
Debit =Iff(TransType = "Debit", Amount, Null)
 
Back
Top