Adding Years!!

  • Thread starter Thread starter Joe Bloggs
  • Start date Start date
J

Joe Bloggs

Thanks for all the help so far.
I have another snag.....
On a subform I have a field called txDate, with the following control
source.... =[Forms]![frmPersonnel]![txDateMain]

This gives a date of when the persons contract is up. I have another field
in this subform that has a dropdown list of 0 to 10 for how many years
extension to the contract he has. This is called 2oe.

So that the txDate field shows the correct termination date, I want to add
the two fields together.

I came up with....:
=DateAdd("yyyy",[2oe],[Forms]![frmPersonnel]![txDateMain])

but it does not work. How can I add them succesfully?

Many thanks again for the past solutions, hopefully you will have an answer
for this!!

Cheers now

Joe
 
Joe said:
Thanks for all the help so far.
I have another snag.....
On a subform I have a field called txDate, with the following control
source.... =[Forms]![frmPersonnel]![txDateMain]

This gives a date of when the persons contract is up. I have another field
in this subform that has a dropdown list of 0 to 10 for how many years
extension to the contract he has. This is called 2oe.

So that the txDate field shows the correct termination date, I want to add
the two fields together.

I came up with....:
=DateAdd("yyyy",[2oe],[Forms]![frmPersonnel]![txDateMain])

but it does not work. How can I add them succesfully?


The DateAdd looks OK to me. What is going wrong?

I'll take a wild guess that either the combo box or the
DateMain value are text values. Try playing around with
something like:

=DateAdd("yyyy",CLng([2oe]),CDate(Forms!frmPersonnel!txDateMain))
 
Back
Top