Elapsed days

T

twalsh

I have a field in a table (tblProfile) showing Date of Hire (DOH) for
employees and a Form showing the info in the table.

I want a text box that shows the number of days since the date of Hire, the
text box doesnt need to be bound to any fields, just display the number of
days. The eventual goal is to use conditional formatting to change the
apperance of the form for employees under 90 days to "red flag" them for
special attention.
 
R

Ron2006

in the OnCurrent event of the form:


me.txtbox = datediff("d",me.hiredate,date())


Ron
 
F

fredg

I have a field in a table (tblProfile) showing Date of Hire (DOH) for
employees and a Form showing the info in the table.

I want a text box that shows the number of days since the date of Hire, the
text box doesnt need to be bound to any fields, just display the number of
days. The eventual goal is to use conditional formatting to change the
apperance of the form for employees under 90 days to "red flag" them for
special attention.

To show the number of days since hire:
Using an Unbound control on your form:
=DateDiff("d",[DOH],Date())

or you can simply use:
=Date()-[DOH]

However, if you just want to show the [DOH] in a different color on
the form, all you need do is use Conditional Formatting.

Select the control. Clisk on Format + Conditional Formatting
Set Condition1 to
Expression Is
In the next box write
Date()-[DOH] <=60
Set the font or Back color to whatever colors you wish.
 
T

twalsh

Thanks that worked beautifully.

Now anyone have any suggestions on how to make it terribly obvious that an
employee has been here under 90 days?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top