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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add six months with a double click event 1

Status
Not open for further replies.

clobo

Technical User
Sep 16, 2008
5
PT
Hi there. I´m a new using access, but completely adicted to it. I posted a message asking help to add 6 months to a date field in a form using a check box. I got a good tip; use a double click event. I´ve searched the net and tried loads of alternatives; everything that I can think of, but things just don´t happen as I wish they would. Can someone help me with the code so that with a double click on a date text box in a form I can add six months to the date alrerady in that text box.

The form is linked to a table with a species id, exit date and return date.

Thanks for the help

best wishes

Carlos
 

Code:
Private Sub DateField_DblClick(Cancel As Integer)
  Me.DateField = DateAdd("m", 6, Me.DateField.Text)
End Sub

This will work whether you enter a date and immediately double click or if you enter a date, go to another control or another record, then come back and double click.

Just replace DateField with your actual textbox name.

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