Time Stamp With No Date.

G

Guest

Hello To all,

I have been looking and read the post about Date/Time Stamp. All the
infomation has been very helpful, for I have gotten it to work. BUt with only
one small problem. I am creating a dispatch log for the company that I work
for. I have servral time box. and I am creating a command button that when
pressed will insert the system time. The problem is that I do not need the
date.

So how do I creat and make the command button insert the time (with No Date).

Thanks
 
D

Douglas J. Steele

Granny's given you the literal answer to your question, but my question is
why would you only want time and not date?

Just because you don't think you need it now doesn't mean you won't need it
in the future. Store the complete timestamp, create a query that uses the
TimeValue function to extract only the time portion and use the query
wherever you would otherwise have used the table. That way, when you do need
both, you'll have them.
 
J

John Vinson

Hello To all,

I have been looking and read the post about Date/Time Stamp. All the
infomation has been very helpful, for I have gotten it to work. BUt with only
one small problem. I am creating a dispatch log for the company that I work
for. I have servral time box. and I am creating a command button that when
pressed will insert the system time. The problem is that I do not need the
date.

So how do I creat and make the command button insert the time (with No Date).

Thanks

So 11:31am Monday and 11:31am Tuesday and 11:31am on December 14, 1742
are all to be treated as exactly the same dispatch time?

You can do two things: one would be to actually use Now() to set the
date and time of the event; you can *DISPLAY* just the time if you
wish, by setting the format property of a form control to Short Time.
This is a bit risky because the date is still there, just not
displayed.

Or, you can use the command button to put the time only into a
textbox:

Private Sub cmdFillInTime_Click()
Me.txtTimestamp = Time
End Sub

This will store a date/time value of #12/30/1899 11:31:54am# if you
click it at 11:31:54. A Date/Time value is stored as a number, a count
of days and fractions of a day since midnight, December 30, 1899, and
you cannot avoid having a date (or for that matter a time) component;
if you store just the time, it's a time on that long-ago date.

I would be strongly inclined to store the date and time together for a
dispatching application; if you do dispatching during the night, I'd
say it's ESSENTIAL because you'll be dealing with times crossing
midnight.

John W. Vinson[MVP]
 
G

Granny Spitz via AccessMonster.com

dezhoutao said:
which country do you are?

Atlantis. Tourists come here to get away from it all because we've paid
mapmakers a hefty premium to keep our island off their maps. Ever wonder
where celebrities and heads of state vacation totally incognito? Now you
know. <g>
 

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