Text Boxes in a Report

G

Guest

I have 3 text boxes in a report and last text box I would like the data to
come from the first two text boxes.

1st text box name TxtTaxForm
2nd text box name TxtDateOfForm
3rd text box name TxtExpiryDate

So if TxtTaxForm = "W-8 ECI" and TxtDateOfForm = 1/1/03 then TxtExpiryDate
would = 12/31 and 3 years from date of form (TxtDateOfForm). TxtExpiryDate
would always be 12/31 and 3 years ie 1/1/03 would be 12/31/06 or 6/30/06
would be 12/31/09.

How would I code that in a report?

Thanks in advance
 
G

Guest

In the TxtExpiryDate control source you can write

IIf([TxtTaxForm] = "W-8 ECI" And [TxtDateOfForm] = #1/1/03# , "12/31/" &
Year(DateAdd("yyyy",3,[TxtDateOfForm])),"")

Use the name of the fields in the table rather then the names of the text
boxes, unless they are the same.
 
G

Guest

What if the date for [txtdateofform] is unknown but I would like it to always
be 12/31 and 3 years from that date.

Ofer Cohen said:
In the TxtExpiryDate control source you can write

IIf([TxtTaxForm] = "W-8 ECI" And [TxtDateOfForm] = #1/1/03# , "12/31/" &
Year(DateAdd("yyyy",3,[TxtDateOfForm])),"")

Use the name of the fields in the table rather then the names of the text
boxes, unless they are the same.

--
Good Luck
BS"D


PJ said:
I have 3 text boxes in a report and last text box I would like the data to
come from the first two text boxes.

1st text box name TxtTaxForm
2nd text box name TxtDateOfForm
3rd text box name TxtExpiryDate

So if TxtTaxForm = "W-8 ECI" and TxtDateOfForm = 1/1/03 then TxtExpiryDate
would = 12/31 and 3 years from date of form (TxtDateOfForm). TxtExpiryDate
would always be 12/31 and 3 years ie 1/1/03 would be 12/31/06 or 6/30/06
would be 12/31/09.

How would I code that in a report?

Thanks in advance
 
M

Marshall Barton

PJ said:
I have 3 text boxes in a report and last text box I would like the data to
come from the first two text boxes.

1st text box name TxtTaxForm
2nd text box name TxtDateOfForm
3rd text box name TxtExpiryDate

So if TxtTaxForm = "W-8 ECI" and TxtDateOfForm = 1/1/03 then TxtExpiryDate
would = 12/31 and 3 years from date of form (TxtDateOfForm). TxtExpiryDate
would always be 12/31 and 3 years ie 1/1/03 would be 12/31/06 or 6/30/06
would be 12/31/09.


Try this more general calculation TxtExpiryDate text box:

=IIf(TxtTaxForm = "W-8 ECI", DateSerial(Year(TxtDateOfForm)
+ 3, 12, 31), what ever you use when taxform is something
else)
 

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