By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,689 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,689 IT Pros & Developers. It's quick & easy.

Format form/report records

P: n/a
I have a form & report based on a query which shows details about
employees performance reviews (hire date, review date, review submital
date, etc). We do 90 day probation reviews as well and I want to be
able to indicate employees who have a hire date that is within 90 days
of the current date and highlight their records in the form and report
with a yellow background. How would this be best accomplished using
DateDiff or DateAdd?

Thanks in advance-

Scott
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Supposing each employee record is in the report's Detail section:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If DateDiff("d", Me!HireDate, Date()) <= 90 Then
Me.Detail.BackColor = vbYellow
Else
Me.Detail.BackColor = 16777215
End If

End Sub

On a form you would use the OnCurrent event procedure to set the
background color for whichever control or section you wish.

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP/oHBYechKqOuFEgEQKV8QCg0jQ5aVzkrIzPuoi7qCHDDN3zLYIA oP4h
G6N8d87VdZtHNnWFQ9LmM/jL
=VdnJ
-----END PGP SIGNATURE-----
Scott Sabo wrote:
I have a form & report based on a query which shows details about
employees performance reviews (hire date, review date, review submital
date, etc). We do 90 day probation reviews as well and I want to be
able to indicate employees who have a hire date that is within 90 days
of the current date and highlight their records in the form and report
with a yellow background. How would this be best accomplished using
DateDiff or DateAdd?

Thanks in advance-

Scott


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.