Calendar Option with Date and Time

A

Alaska1

I want to setup the calendar pop-up option to enter dates on a form. The
calendar works fine, but I need it to also enter time along wit the dates.
In the table I have the date to display along with the time but when you
choose the date from the calendar option it only shows the date not the time.
I went into the table and it is only showing the date. I need the time it
is entered because i have a report calculating the date and time difference.
 
W

Wayne-I-M

Hi

I think the reason for this is that the calender control is not really meant
for selecting Now() but rather past or previous dates - there are much better
ways of selecting today's date.

You could just use the Now() function OnClick, AfterUpdate, OnLoad, etc, etc
or anywhere else that you want to record the time/date of an event - I would
not use the calender control for this.

If you have a control called txtTimeDate you could have something like
Private Sub ButtonName_Click()
Me.txtTimeDate = Now()
End Sub

to give you the time date to store in your table

HtH
 
A

Alaska1

Thank you for your response. I will keep that in mind. The problem for me
is the date will not always be the current date. Some of the dates will have
to be put in from past dates.
 
W

Wayne-I-M

I always like to "try" (not always possible) and keep the number of fields in
a table down to the minimum required. But you could (if you really want to
keep using the calendar control) have a clock on the form as well and store
the time in a seperate field or (better) use 2 unbound boxes on your form to
collect date and time and then combine them before you store them in a
date/time field in your table.

I have just tried to gain a time stamp (not date) from a calendar control
and couldn't do it. Mabe there is a way that don't know of and someone else
will answer with the method. But if it's not possible then you should just
add a date and time into 2 boxes (unbound) then combine them into the correct
format for a date/time field in your table

You could make it very simple for users to orperate by placing 2 buttons on
the form
Use the time now
Use another date time
OnClick the 2 button would open the calendar and a clock - select these to
add the data

Hope this helps
 

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