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

DateAdd() and default values

Status
Not open for further replies.

Gaffi1

Technical User
Apr 23, 2004
70
US
I'm using a form to input new employees into the database. On the form are fields for hire date and specific benefit eligibility dates. The eligibility dates feed directly off the hire date. (i.e. 30 days after hire date...) To prevent the need to add these dates to all these fields (there are 4) for every employee, I want to set the default value of these fields to be
Code:
=DateAdd("d",30,[CurrentHireDate])
or whatever number of days the specific benefit requires.

My problem is this: I can't get all the fields to update correctly, but I can get one to work at a time. It appears that Access doesn't want me to be able to do this on multiple fields at the same time. Does anyone know how to get around this?
 
How are ya Gaffi1 . . . . .

You dont really need the DateAdd function. Just try:
Code:
[blue] = [HireDate] + 30[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks, but I already tried that as well. It was what I tried first, and that led me to DateAdd(). It seems that you get the same problem- only 1 field at a time. If you use your idea plus the DateAdd(), I suppose you could get 2 fields to work, but I need more than that.
 
Gaffi1 . . . . .

In the [purple]AfterUpdate[/purple] event of the [purple]HireDate[/purple] control, try:
Code:
[blue]Me.ReCalc[/blue]

Calvin.gif
See Ya! . . . . . .
 
Outstanding TheAceMan! Everything is working. With everyone's help we were able to deploy our new employee database on time with virtually no bugs. You guys are INCREDIBLE!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top