If new record, then populate field with sysdate

A

andy

Could someone please show me the code to do the following:

If the user creates a new record, the txt_DateField1 field
value is set to the current date. The txt_DateField1 field
is a text box with its enabled, and locked properties set
to 'No' so that no one can tamper with them.

Thank you in advance
God bless you
Andy
 
R

Rick Brandt

andy said:
Could someone please show me the code to do the following:

If the user creates a new record, the txt_DateField1 field
value is set to the current date. The txt_DateField1 field
is a text box with its enabled, and locked properties set
to 'No' so that no one can tamper with them.

Set the DefaultValue property to =Date()
 
J

John Vinson

Could someone please show me the code to do the following:

If the user creates a new record, the txt_DateField1 field
value is set to the current date. The txt_DateField1 field
is a text box with its enabled, and locked properties set
to 'No' so that no one can tamper with them.

Just set the Default property of txt_DateField1 to

Date()

txtDateField2 should have Enabled = Yes, Locked = No for the user to
be able to work with it; txt_DateField1 should be Enabled = No, Locked
= Yes.
 

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