Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datestamp a record 2

Status
Not open for further replies.
May 5, 2000
168
US
I created a macro to date stamp records when they are changed.&nbsp;&nbsp;I added the LastEditDt field to the form, set the Enabled property to NO and locked property to YES.&nbsp;&nbsp;The macro is attached to the BeforeUpdate event of the form.&nbsp;&nbsp;The action is to SetValue of LastEditDt field to Now().<br><br>When I changed a record on the form I got a message &quot;The object doesn't contain the Automation object &quot;LastEditDt&quot;&nbsp;&nbsp;You tried to run a Visual Basic procedure to set a property or method for an object.&nbsp;&nbsp;However, the component doesn't make the property or method available for automation opertaions.&nbsp;&nbsp;Check the components'documentation for information on the properties and methods it makes available for Automation operations.<br><br>I changed the &quot;LastUpdtDt&quot; field Enable prop back to YES and the Locked prop to NO.&nbsp;&nbsp;I tried changing a record again and then use my combo box to go to another record.&nbsp;&nbsp;This time I get a run time error 2105 saying that I can't go to the specified record because I'm at the end of a recordset.&nbsp;&nbsp;It refers to the line in my combo box afterupdate event that says &quot;Me.Bookmark = Me.RecordsetClone.Bookmark&quot;<br><br>It seems to me that a date stamp is a common feature for tracking updates in a record.&nbsp;&nbsp;There should be an easier way to create this process.&nbsp;&nbsp;Does anyone know one?<br><br>
 
Go to design view of your form. Take the control off of the form altogether if you don't need it to display there. <br><br>Go to the Before Update even for the form. Type this:<br><br>Me!LastEditDt= Date<br><br>Don't use the macro<br><br>
 
BTW, as cornerstone suggests, Date is better for data alone than Now. Now captures time as well as date in the underlying fields, even if you format and display it as a date .
 
Thanks so much Cornerstone and Elizabeth.&nbsp;&nbsp;That worked perfectly.&nbsp;&nbsp;I added LastEditDt to the form as an unbound control (I like users to see the datestamp).<br><br>This forum is fantastic!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top