Adding Years!!

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
 
M

Marshall Barton

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

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