Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date add 1 year

Status
Not open for further replies.

overflo

Technical User
Feb 10, 2003
70
AU
Hi
I am trying to help someone and and I'm only a beginner myself in VBA.

We have an after update event of a text box (txtDatePaid). What we need it to do is grab the date from another text box (txtDueDate) add 1 year (the date will always be 30th June) and put this back into txtDueDate. I realise there are a few ways of doing this, what would be the simplest?

Thanks in advance
 
I think this is what you're asking for:
Code:
Private Sub txtDatePaid_AfterUpdate()
  Me.txtDueDate = DateAdd("yyyy", 1, Me.txtDueDate)
End Sub

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Glad to help!

Linq

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top