Macro or Code?

J

JudyB

Can someone please tell me the best way to accomplish the following: I have
a subtable with fields (Department, Job Title, Date In, Date Out, and a
Service Time field that automatically computes the weeks between the Date In
and Date Out fields). If the Date Out field is Null, this is a person's
current position and I would like to know how to write code or use a macro
to calculate all time previously served in the person's current Department
and Job Title. Is this possible? Any help is greatly appreciated. Thanks
in advance.
 
P

PJFry

In the table that contains all of time time the person has worked, is there
something that identifies the person?

In the list below you have Department and Job title, but I don't see a field
that tells you who a particular record belongs too.

Where will the information be displayed? In a form, report, etc?

That should get us started.

PJ
 
J

John W. Vinson

Can someone please tell me the best way to accomplish the following: I have
a subtable with fields (Department, Job Title, Date In, Date Out, and a
Service Time field that automatically computes the weeks between the Date In
and Date Out fields). If the Date Out field is Null, this is a person's
current position and I would like to know how to write code or use a macro
to calculate all time previously served in the person's current Department
and Job Title. Is this possible? Any help is greatly appreciated. Thanks
in advance.

No code is needed. I presume that your Service Time field is now calculated
with an expression (using DateDiff?) referencing Date In and Date Out. Just
change the Date Out expression to

NZ([Date Out], Date())

to use the Date Out value if it exists, and today's date if it's NULL.
 
J

JudyB

Sorry...yes I do have a field titled EmployeeID and also a field to identify
the record. I made a mistake in stating that all the fields were in a
subtable. The information is actually in a subform. As you can see...I am
very green. This is my first database. I am wanting to display the total
service time in a form.
 

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