Button On Form To Click To Change Other Field

  • Thread starter Thread starter Xtrapont
  • Start date Start date
X

Xtrapont

Hi,

I would like to have a button on a form that I can click
and it will change the contents of one field in the
current record showing in the form to the current date
and the contents of another field in the current record
showing in the form to todays date plus 14 days
 
In the Click event of the button

Me.txtFirstTextbox = Date
Me.txtSecondTextbox = Date + 14

The reason just adding 14 works is because of the way VBA handles dates. The
date is stored as the number of days since a default date (Dec 30, 1899).
The decimal portion of the number is the time of day and the whole portion
of the number is the date.

Example:
1.25 would be Dec 31, 1899 6:00 AM
 
Back
Top