
August 17th, 2004, 08:23 PM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Click to update date field
In updating paid annual fee for a record, this code enabled me to add a command button to the form so the user can just click to add a year to the current field date.
Option Compare Database
Private Sub cmdAddyear_Click()
Dim yearadd As Date
Dim curdate As Date
Forms![New Record Form].Controls![Paid Until].SetFocus
If Forms![New Record Form].Controls![Paid Until].Text <> "" Then
curdate = Forms![New Record Form].Controls![Paid Until].Text
yearadd = DateAdd("yyyy", 1, curdate)
Forms![New Record Form].Controls![Paid Until].Text = yearadd
End If
End Sub
rnrcretti@commspeed.net
|