Unbound Textbox

AccessTexas

Registered User.
Local time
Today, 02:54
Joined
Dec 3, 2005
Messages
18
I have a form that calls up an employee that also lists their hire date. I have an unbound text box that calculates the years of service by DateDiff(). It works for the first record but sticks for all the subsequent records. I've tried an afterUpdate or Change on the bound Hire_Date text box that is Me.txtYearsOfService = DateDiff("yyyy",Me.Hire_Date,Now) but it still sticks to the first record.

I'm sure this is basic but can't see the obvious. Please relieve the pain.

Thanks
 
Your code should be in both the AfterUpdate event of the bound Hire_Date text box and the Current event of the form.
 
That was what I was missing. I had tried both the bound text box and the form AfterUpdate and DataChange but didn't think of the Current. Thanks for the quick reply and taking away a lot of frustration.
 

Users who are viewing this thread

Back
Top Bottom