Sub form filtering, dates between * and * (1 Viewer)

Charlie

Registered User.
Local time
Today, 05:01
Joined
Jan 7, 2000
Messages
16
Dear Accessers,

Hi, I've a small problem that I'm not sure how to solve.

I'm making a staff/department performance database and I have a form that allows me to select a department. This is linked to a subform which shows me the staff in that department.

I then noticed that of course staff move around through departments. Rather than deleting the staff member or changing their department, I decided to create a new staff member of the same name for the new department. Obviously this will all get thoroughly confusing when I come to print up my report.

So I decided to use a "start date" and an "end date" which describes the time the staff member was in that department (I thought of this a 2 am last night!).

My problem is that now I want the staff-subform to decide whether a staff member is in this department at this "record date" or not. I'd like to link the "record date" field to the subform so that if "record date" is larger than "start date" and smaller than "end date" then the staff member is shown otherwise they aren't.

I could do this in VBA quite happily but I don't know how to do it with link child/master properties. Another thing I've got 50 odd staff on there already and only a few of them have moved around so most of the "end date"'s will be NULL. I'd like to be able to use this to mean that they have always been in the department as opposed to causing an error.

I'm sure that I'm missing something quite small. Can you help??

Thanks in advance for your time and good counsel,

Charlie
 

S

Registered User.
Local time
Today, 06:01
Joined
Feb 17, 2000
Messages
33
The subform origin should be a query with these criterias:
[Start date]: >= [report date]
[End date] <= [repot date] or Is Null

Link just the department fields

Hope this helps you
 

Users who are viewing this thread

Top Bottom