date()

E

Emma

Hello I would like to have a field where the date is the current date
today,(automatic), but if the user opens the form tommorow the date will be
yesterday's date,(retrieved from the same original automatic date). Is there
a function like date() which will put in the automatic date and then store
it?
 
K

Ken Sheridan

Set the DefaultValue property of the field to Date() in table design. The
current date will be inserted into a record when its created, and retained
thereafter.

Ken Sheridan
Stafford, England
 
J

Jerry Whittle

At the table design view go to the date field. In the default value property
put Date(). Any new records will have the date from that computer stored in
that field.

It will be possible to change the date though. If you don't want that to
happen, it will take some more work.
 
K

Ken Sheridan

As regards Jerry's point, if you set the Locked property of the control bound
to the field in your form to True (Yes) and its Enabled property to False
(No) then users won't be able to change it (or even set focus to it). They
could still change it in the table in raw datasheet view, though, if they are
real meddlers!

Ken Sheridan
Stafford, England
 
E

Emma

It doesn't seem to be working I cleared the cell on the form in form view so
it's empty closed it then openned it again to see if the Date() is in there
but it's still blank?
 
E

Emma

Sorry it is working when I enter a new client. That was great advice guys
thanks for the help!
 

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