If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Automatic update of Date fields, Access 2003
I would like to add a field to my Customer Contacts table that automatically
sets to the date the record was entered plus another date field that resets automatically to the date a record is altered. Can I do this and how? |
#2
|
|||
|
|||
The creation date is easy. Just add a field to your table, and set its
Default Value property to: =Date() The modification date can only be achieved if you update your data through a form. Use the BeforeUpdate event procedure of the form to set the field's value to Date. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "HeinzD" wrote in message ... I would like to add a field to my Customer Contacts table that automatically sets to the date the record was entered plus another date field that resets automatically to the date a record is altered. Can I do this and how? |
#3
|
|||
|
|||
Thanks Allen, how do I do this: The modification date can only be achieved if you update your data through a form. Use the BeforeUpdate event procedure of the form to set the field's value to Date. "Allen Browne" wrote: The creation date is easy. Just add a field to your table, and set its Default Value property to: =Date() The modification date can only be achieved if you update your data through a form. Use the BeforeUpdate event procedure of the form to set the field's value to Date. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "HeinzD" wrote in message ... I would like to add a field to my Customer Contacts table that automatically sets to the date the record was entered plus another date field that resets automatically to the date a record is altered. Can I do this and how? |
#4
|
|||
|
|||
1. Open your form in design view.
2. Open the properties box (View menu). 3. Making sure the Title of the Properties box reads "Form" so you are looking at the properties of the form, not those of a control, choose the Before Update property on the Events tab. 4. Set the Property to [Event Procedure] 5. Click the Build button beside this. Access opens the code window. 6. Make it read like this: Private Sub Form_BeforeUpdate(Cancel As Integer) Me.[NameOfYourDateFieldHere] = Date End Sub -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "HeinzD" wrote in message ... Thanks Allen, how do I do this: The modification date can only be achieved if you update your data through a form. Use the BeforeUpdate event procedure of the form to set the field's value to Date. "Allen Browne" wrote: The creation date is easy. Just add a field to your table, and set its Default Value property to: =Date() The modification date can only be achieved if you update your data through a form. Use the BeforeUpdate event procedure of the form to set the field's value to Date. "HeinzD" wrote in message ... I would like to add a field to my Customer Contacts table that automatically sets to the date the record was entered plus another date field that resets automatically to the date a record is altered. Can I do this and how? |
#5
|
|||
|
|||
Thanks Allen,
that worked beautifully. Great help. "Allen Browne" wrote: 1. Open your form in design view. 2. Open the properties box (View menu). 3. Making sure the Title of the Properties box reads "Form" so you are looking at the properties of the form, not those of a control, choose the Before Update property on the Events tab. 4. Set the Property to [Event Procedure] 5. Click the Build button beside this. Access opens the code window. 6. Make it read like this: Private Sub Form_BeforeUpdate(Cancel As Integer) Me.[NameOfYourDateFieldHere] = Date End Sub -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "HeinzD" wrote in message ... Thanks Allen, how do I do this: The modification date can only be achieved if you update your data through a form. Use the BeforeUpdate event procedure of the form to set the field's value to Date. "Allen Browne" wrote: The creation date is easy. Just add a field to your table, and set its Default Value property to: =Date() The modification date can only be achieved if you update your data through a form. Use the BeforeUpdate event procedure of the form to set the field's value to Date. "HeinzD" wrote in message ... I would like to add a field to my Customer Contacts table that automatically sets to the date the record was entered plus another date field that resets automatically to the date a record is altered. Can I do this and how? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Acess 2002 Service Pack 3 | J. Haney | General Discussion | 2 | July 29th, 2004 12:59 AM |
Useless Access 2003 | tired, angry, sucidial and bored | General Discussion | 10 | July 21st, 2004 11:52 PM |
Publisher 2003 hotfix package Update (KB 838901) | Brian Kvalheim - [MSFT MVP] | Publisher | 0 | May 7th, 2004 08:38 PM |