Date and Time

S

Swordfish

Hello,

I have a dilemma, someone may have encountered in the past. I have a form
which among other fields has a field called Date Received. This field is
pretty important, in that it starts the time ticking for a calculation that
measures performance.

Here’s the dilemma, in an attempt to keep all entries consistent, I
currently have a popup calendar that when the current date is selected enters
that date and time into a Date Received field. The problem resides when the
entry is not the current date but a prior date. If someone receives material
prior to the current date the time cannot be accounted for when using the
popup calendar to enter the prior date. What I would like your assistance
with is figuring out: If the received date is today’s (current) date then
use the popup calendar for that date and time. if the received date is not
today’s date then the date should be entered manually in the Date Received
field with the mm/dd/yyyy format and always have a default time of 4:30:00
pm.

Any ideas and assistance would be great!

Thanks
 
F

fredg

Hello,

I have a dilemma, someone may have encountered in the past. I have a form
which among other fields has a field called Date Received. This field is
pretty important, in that it starts the time ticking for a calculation that
measures performance.

Here¢s the dilemma, in an attempt to keep all entries consistent, I
currently have a popup calendar that when the current date is selected enters
that date and time into a Date Received field. The problem resides when the
entry is not the current date but a prior date. If someone receives material
prior to the current date the time cannot be accounted for when using the
popup calendar to enter the prior date. What I would like your assistance
with is figuring out: If the received date is today¢s (current) date then
use the popup calendar for that date and time. if the received date is not
today¢s date then the date should be entered manually in the Date Received
field with the mm/dd/yyyy format and always have a default time of 4:30:00
pm.

Any ideas and assistance would be great!

Thanks

Don't enter anything if it is for the current date. Leave the control
blank.

Set the Form's BeforeUpdate event to:
If IsNull([Date Received]) then
Me.[Date Received] = Date + #4:30 PM# ' See * below
Else
' Add 4:30 PM if any date has been entered
Me.[Date Received] = Me.[Date Received] + #4:30 pm#
End If

* Change
Me.[Date Received] = Date + #4:30 PM#
to
Me.[Date Received] = Now()
if you wish the actual entry date and time entered (instead of 4:30
PM) if it is the current date.
 
M

Mike Painter

Swordfish said:
Hello,

I have a dilemma, someone may have encountered in the past. I have a
form which among other fields has a field called Date Received. This
field is pretty important, in that it starts the time ticking for a
calculation that measures performance.

Here's the dilemma, in an attempt to keep all entries consistent, I
currently have a popup calendar that when the current date is
selected enters that date and time into a Date Received field. The
problem resides when the entry is not the current date but a prior
date. If someone receives material prior to the current date the
time cannot be accounted for when using the popup calendar to enter
the prior date. What I would like your assistance with is figuring
out: If the received date is today's (current) date then use the
popup calendar for that date and time. if the received date is not
today's date then the date should be entered manually in the Date
Received field with the mm/dd/yyyy format and always have a default
time of 4:30:00 pm.

Any ideas and assistance would be great!

There is no need for a calendar if the date is usually the current date. Use
Date() as the default value.
If your calendar will not let you pick a past date, get one that will.
 
S

Swordfish

Good Day Mr. Fredg,

Thank you for responding.

I placed the code as you mentioned but I am receiving an Runtime 2115 with
this line Me.[Date Received] = Me.[Date Received] + #4:30 pm#

Would you have any ideas.

Let me know

Thanks

fredg said:
Hello,

I have a dilemma, someone may have encountered in the past. I have a form
which among other fields has a field called Date Received. This field is
pretty important, in that it starts the time ticking for a calculation that
measures performance.

Hereʼs the dilemma, in an attempt to keep all entries consistent, I
currently have a popup calendar that when the current date is selected enters
that date and time into a Date Received field. The problem resides when the
entry is not the current date but a prior date. If someone receives material
prior to the current date the time cannot be accounted for when using the
popup calendar to enter the prior date. What I would like your assistance
with is figuring out: If the received date is todayʼs (current) date then
use the popup calendar for that date and time. if the received date is not
todayʼs date then the date should be entered manually in the Date Received
field with the mm/dd/yyyy format and always have a default time of 4:30:00
pm.

Any ideas and assistance would be great!

Thanks

Don't enter anything if it is for the current date. Leave the control
blank.

Set the Form's BeforeUpdate event to:
If IsNull([Date Received]) then
Me.[Date Received] = Date + #4:30 PM# ' See * below
Else
' Add 4:30 PM if any date has been entered
Me.[Date Received] = Me.[Date Received] + #4:30 pm#
End If

* Change
Me.[Date Received] = Date + #4:30 PM#
to
Me.[Date Received] = Now()
if you wish the actual entry date and time entered (instead of 4:30
PM) if it is the current date.
 

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