small problem, I need some help!!

vividor

Registered User.
Local time
Today, 11:49
Joined
Aug 5, 2002
Messages
31
I am creating a report that list my days off from work.

In this report I want to show a column for my "Day Request(01/20/2003)", "Day Recorded (check box)".
I want the Day Recorded to check itself if the day is equal to "Day Request" using, Now().

It will look something like this:

Day Request Day Recorded
----------------- --------------------
01/02/2003 x
01/03/2003 x
01/06/2003 x
01/21/2003
01/30/2003

Do I have to create a query for this or I can just do it on the report ?
 
Last edited:
Hi vividor,

There are several ways to do this! One way to do it in a report is like this:

I assumed that in your table you have something called day_request which is a date field that you use to indicate the day you are intending to take off.

In your report, add a text field and call it txtDay_Request and put day_request as the control source. Then add a checkbox (we'll just call it Check1). Both of these should go into the detail section.

Go into the VBA part (select "View", then "Code") and paste this in after the "Option Compare Database" and "Option Explicit" lines:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Format(txtDay_Request, "dd/mm/yyyy") <= Format(Now(), "dd/mm/yyyy") Then
Check1 = 1
Else
Check1 = 0
End If
End Sub


Hope that helps and good luck!

-Sean
 

Users who are viewing this thread

Back
Top Bottom