Saving the date & time from a form

C

Clarkey

Hi there,

Wondering if someone could assist with some difficulty I'm having with
saving the date and time from a form into a table.

I have a form which displays the Date() and Time() in a text box using the
Control Source property. When the form is opened it automatically inserts
this data. I cant quite work out how to then save the data from these fields
into the table, as the Control Source is what usually links this to the table.

Any solutions?
 
A

Al Campagna

Clarkey,
Sounds like your Date and Time (which really couls be done with just a
Now()) is just a calculated field.
Also, it sounds as though you're trying to capture the Date and Time
the new record is created.

Add a field to your table behind the form, and call it DOC
(DateofCreation), and use that field as the ControlSource of the text
control on your form.
Make the Default Value...
= Now()
Every time a new record is created, the Date and Time will be captured
to the DOC field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
M

Mike Painter

There is a problem with using Now() if you wish to do a between search on a
date range.
I'd keep Date() and maybe use Now() for just the time.
If not you must use the time in the search criteria
 
J

John W. Vinson

There is a problem with using Now() if you wish to do a between search on a
date range.
I'd keep Date() and maybe use Now() for just the time.
If not you must use the time in the search criteria

Or use a range, as is perfectly standard in many databases:
= [Enter date:] AND < DateAdd("d", 1, [Enter date:])

In other words if you need the date and time, store both in one field. It's
easy to search for them with a bit of care.
 

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