Inserting current time?

G

Guest

I have a database that I'm trying to use to dispatch and keep track of calls
for security officers. It has "Call Time:", "Time In:" and "Time Out:" text
entry boxes that I would like the dispatcher to be able to double click the
mouse on to enter the current times - when the mouse is clicked on the text
entry box.

However, In the event that an entry needs to be altered and the time
corrected, I want the dispatcher or officer to be able to manually enter the
time as well. Any thoughts?
 
A

Alex White MCDBA MCSE

Hi,

the function you are looking for is now()

e.g.

me.starttime.value = now()

you may want to format the time as the above function gives you time and
date
so look at the format function
e.g.

me.starttime.value = format(now(),"short time")

just put the above line within your button click events and it should work,
if you need more help pots back here
 
J

Joe

Oscar,

I would enter the formula Alex suggested in the default property of the
property page.

That way when you create a new record it the current time will be inserted
automatically.

ie. = format(now(),"short time")
 
J

John Vinson

I have a database that I'm trying to use to dispatch and keep track of calls
for security officers. It has "Call Time:", "Time In:" and "Time Out:" text
entry boxes that I would like the dispatcher to be able to double click the
mouse on to enter the current times - when the mouse is clicked on the text
entry box.

However, In the event that an entry needs to be altered and the time
corrected, I want the dispatcher or officer to be able to manually enter the
time as well. Any thoughts?

I've developed three dispatching systems now (no connection between
them, just an odd coincidence)...

Just click the ... icon by the DoubleClick event property of the
textbox and enter:

Private Sub controlname_DoubleClick() ' Access gives you this free
Me!controlname = Now
End Sub


John W. Vinson[MVP]
 
G

Guest

John:

When I click on the icon it just pulls up a window that says "Choose
Builder" and gives me the option of selecting an "Expression Builder", "Macro
Builder", or "Code Builder." None of which I know what to do with. What do
I do at this point?
 
J

John Vinson

John:

When I click on the icon it just pulls up a window that says "Choose
Builder" and gives me the option of selecting an "Expression Builder", "Macro
Builder", or "Code Builder." None of which I know what to do with. What do
I do at this point?

Sorry... should have said! Code Builder. Access will give you the Sub
and End Sub lines; just add the expression setting the value of the
control to Now().

Note that this gives the current *date and time* - if you just want
the time use Time() instead. Because of the way Access stores
date/time values, Time() will be a time on December 30, 1899.


John W. Vinson[MVP]
 
G

Guest

Thanks again John! Since you've put together three of these animals...would
it be possible for me to get a copy of one to see how you did it???? As you
can see, I'm new to this and having GREAT difficulty. Actually, at this
point and with what I know about doing this, I have no business trying to put
this together. However, if I were to say I'm on a shoestring budget...I
would be exagerating! In any event, if you have any ideas as to where I
could find an application that would do the job for very little money, or any
other advice you have, I would greatly appreciate it. Thanks again!
 
J

John Vinson

Thanks again John! Since you've put together three of these animals...would
it be possible for me to get a copy of one to see how you did it????

I'm afraid not. One was for the Idaho State Police, and it was never
implemented (long sad story there...); the other two were components
of two much larger systems for two animal shelters/humane societies,
and I'm under obligations to my partner in development not to
distribute them. (Well, we're selling them... $10K and up). The were
VERY specialized and not designed at all as general purpose templates.


John W. Vinson[MVP]
 

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