Date & Time Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Just a quick question. I have a database which tracks all Calls logged
within our system, there are various fields within the database, but the main
ones i need to work on are, date call logged, Call Status (whether the call
is open, closed or cancelled), and the date the call was closed.

What i am trying to do is create a log of how long it takes to complete a
call. When the call is closed i would like the database to automatically
generate the time and date the call was closed. The call status is a drop
down box, with a lookup to the three values.

Thanks in advance!!
 
Use the AfterUpdate event of the Call Status box to assign the date and
time:

If Me.[Call Status] = "Closed"
Me.[ClosedDate] = Now()
Else
Me.[ClosedDate] = Now()
End If
 
Thanks for that Allen, it worked fine, i had to tweak the code a little, (i
took out if else = now() bit), but apart from that it was great. Cheers

Allen Browne said:
Use the AfterUpdate event of the Call Status box to assign the date and
time:

If Me.[Call Status] = "Closed"
Me.[ClosedDate] = Now()
Else
Me.[ClosedDate] = Now()
End If

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Sukh said:
Just a quick question. I have a database which tracks all Calls logged
within our system, there are various fields within the database, but the
main
ones i need to work on are, date call logged, Call Status (whether the
call
is open, closed or cancelled), and the date the call was closed.

What i am trying to do is create a log of how long it takes to complete a
call. When the call is closed i would like the database to automatically
generate the time and date the call was closed. The call status is a drop
down box, with a lookup to the three values.

Thanks in advance!!
 
Sorry. Lots of interruptions today. The else should have been:
Me.[ClosedDate] = Null
and the purpose of that is to lose the closed date if the status is changed
to something else again later.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Sukh said:
Thanks for that Allen, it worked fine, i had to tweak the code a little,
(i
took out if else = now() bit), but apart from that it was great. Cheers

Allen Browne said:
Use the AfterUpdate event of the Call Status box to assign the date and
time:

If Me.[Call Status] = "Closed"
Me.[ClosedDate] = Now()
Else
Me.[ClosedDate] = Now()
End If

Sukh said:
Just a quick question. I have a database which tracks all Calls logged
within our system, there are various fields within the database, but
the
main
ones i need to work on are, date call logged, Call Status (whether the
call
is open, closed or cancelled), and the date the call was closed.

What i am trying to do is create a log of how long it takes to complete
a
call. When the call is closed i would like the database to
automatically
generate the time and date the call was closed. The call status is a
drop
down box, with a lookup to the three values.
 

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

Back
Top