Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2007, 11:47 AM
Authorized User
 
Join Date: Aug 2006
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating Last_Updated Field

Hi there,
  I am working on a form which contains a sub-form. In the sub-form, there are two fields which can be edited by the users and when either of them is updated, I need to change the last_update field in the table. What is the best way to do this?

Any help would be appreciated.

Best Regards,
Arholly

 
Old January 17th, 2007, 11:47 AM
Authorized User
 
Join Date: Aug 2006
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

And just for clarification, one of the two fields users can update is a checkbox, the other is a drop down.

 
Old January 17th, 2007, 12:01 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Use the Before Update event of the form.

Me.last_update = Date()



mmcdonal
 
Old January 17th, 2007, 12:03 PM
Authorized User
 
Join Date: Aug 2006
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now that will not update the form if there are no changes, right?

 
Old January 17th, 2007, 12:05 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

That will ONLY update the record source IF there is an Update made to the data, which is what you are looking for.


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error on updating the date field surya MySQL 2 September 16th, 2008 11:56 PM
Updating Field in Form cthibault Access 2 January 8th, 2008 03:37 PM
Updating a Date field based on another field arholly Access VBA 6 November 22nd, 2006 11:19 AM
Updating a field using a SELECT statement? katie123 Access VBA 1 April 12th, 2006 10:23 AM
Referring to a field and updating Programmatically vmerc Access VBA 4 January 12th, 2006 10:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.