Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / August 2004

Tip: Looking for answers? Try searching our database.

default value date()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christina - 30 Aug 2004 02:40 GMT
Hi, if you use the date() function as a default value in a
table, does it automatically update when you open the
table or actually modify a record?  Is there a way to have
the creation date as the value, or a modification date
(I'm assuming both of these would require you to actually
edit the record in order for them to change).  Thanks in
advance.
Allen Browne - 30 Aug 2004 02:51 GMT
DefaultValue applies only to the creation of the record, so you cannot use
that to record the modification date. Instead, use the BeforeUpdate event of
the form where edits are made:

Private Sub Form_BeforeUpdate(Cancel As Integer)
   Me.[ModificationDate] = Date()
End Sub

Signature

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.

> Hi, if you use the date() function as a default value in a
> table, does it automatically update when you open the
[quoted text clipped - 3 lines]
> edit the record in order for them to change).  Thanks in
> advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.