add a future date

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

Guest

I need help with code I have a current date field named Date and a futer
date field named ExpireDate. I can't seem to get one month from current date
to enter into expire date. this is what I have:
Private Sub Date_AfterUpdate()
me.ExpireDate = DateAdd("m", 1, Me)
End Sub
please help, Edward Keith
 
Me is a reference to the form (not text box).

Try:
me.ExpireDate = DateAdd("m", 1, Me.[Date])

Note that Date is a reserved word in VBA, so not a good name for a field.
Consider changing the name to HireDate or something.

If this is Access 2000 or later, before you change the name, make sure the
Name AutoCorrect boxes are unchecked under:
Tools | Options | General
Otherwise many bad things can happen, as explained here:
http://allenbrowne.com/bug-03.html
 

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

Back
Top