Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > date created no prob, date updated big headache


Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2001, 03:55 AM
pjlapham
Guest
 
Posts: n/a
Question date created no prob, date updated big headache


I hope VBA stands for VBAccess. Let me know and I'll post elsewhere if i need to.

MSAccess: when a record is created i'm using simple default value = date() for the 'date created' field. But how do I get the 'date updated' field to be updated when any part of the record is updated? which event do I use? what event procedure would I use? in table definition? in form properties?
I figure this is super simple. the VB help files are more torment than anything else.
Thanks for your help!

Reply With Quote
  #2  
Old 03-06-2001, 01:07 PM
PWNettle PWNettle is offline
Verbose Coder

Retired Moderator
* Guru *
 
Join Date: Dec 1999
Location: Phoenix, Arizona
Posts: 3,011
Default Re: date created no prob, date updated big headache

VBA stands for VB for Applications. Access is one of those applications.

One thing you could do is set your 'date updated' field to Date() whenever a record is modified. If you had your data bound to a form you could put some code in the 'BeforeUpdate' event of the form to do this. You'd need the 'date updated' field to be bound to a textbox on your form but you could make it invisible (set Visible to False) because your user doesn't need to see this field. Your form's BeforeUpdate event would end up looking something like:
<pre>Private Sub Form_BeforeUpdate(Cancel As Integer)

[DateUpdated] = Date ' Change to whatever you're calling your 'date updated' field/textbox.

End Sub</pre>

I can post a tiny sample database if this isn't clear enough.

Hope this helps,
Paul


Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->