generate todays date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to open a form and have the current date automatically displayed
and stored in the Database 'Date' field I have.
 
Kirt84 said:
I would like to open a form and have the current date automatically
displayed and stored in the Database 'Date' field I have.

Create a control and use

= Date()

I have not done this but I believe you can set the default date to
Date() in the field definition. If you do that then you should be able to
just display that field rather than make a different control.

There are other issues to be concerned with like updating the date when
someone views or edits the data. How do you want that handled?
 
Your form is bound to a Table, and will have some text boxes bound to
fields. Each bound text box has a different value for each record in the
table. When you open the form, are you wanting to change the value in the
table for the displayed record? For every record in the table? Or only for
the new record?
 
There's a built-in function Date() that will do this for you.

By the way, do not name your own field or variable Date: it's a reserved
word, and using it for your own purposes can cause problems.
 
Hi

When a new record is entered on the input Form I want the current date
automatically generated but then stored in the table.
 
In that case, set the Default Value property of the text box to:
=Date()

(BTW, Date is a reserved word in JET (the query engine) and also in VBA (the
code language), so if you name your field Date there is a very good chance
that it will be misunderstood. You might like to change the name to
InvoiceDate, or EnteredDate, or something like that.)
 
THANK SO MUCH!!
--
Thank you for your help


Allen Browne said:
In that case, set the Default Value property of the text box to:
=Date()

(BTW, Date is a reserved word in JET (the query engine) and also in VBA (the
code language), so if you name your field Date there is a very good chance
that it will be misunderstood. You might like to change the name to
InvoiceDate, or EnteredDate, or something like that.)
 

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

Back
Top