Print data in different control depending upon data in field

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
 
M

Marshall Barton

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)
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top