Alpha Video Training
Results 1 to 4 of 4

Thread: Determine Record Add/Change and change date fields accordingly

  1. #1
    Member
    Real Name
    Mike Thompson
    Join Date
    Aug 2008
    Posts
    58

    Default Determine Record Add/Change and change date fields accordingly

    When a record is added to a table I want to update my "date_entered" field with a calculation, date(). After that initial entry date entered will never change. When any field in a record is changed I want to update my "date_changed" field with a calculation, date(). I've looked at Record_Update()=.t. and Record_Add()=.t.. I've also tried to play around with events on the form. Anybody have any ideas on what is the best way to do this. Thanks

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Determine Record Add/Change and change date fields accordingly

    Discussed before. Try searching for "Date stamp". If I get a chance I'll post back some links.

  3. #3
    Member
    Real Name
    Mike Thompson
    Join Date
    Aug 2008
    Posts
    58

    Default Re: Determine Record Add/Change and change date fields accordingly

    After starting the thread some other similar threads appeared at the bottom of screen. I used the technique of date_entered being a default expression of Date() with the boxes checked for at the beginning of data entry and if not touched. For date_changed I used a calculated field and date() as the expression. Both my fields are hidden and not used on forms. Seems to work well.

  4. #4
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default Re: Determine Record Add/Change and change date fields accordingly

    NO, NO, NO - Don't do it that way! You're just asking for trouble in the future. (You got the Create date right but not the Change date.)

    This is a very common mistake. Read this post for some reasons for using Create/Change dates in EVERY table (you might be doing that already) then - MOST IMPORTANT - follow the link in that post to an explanation of a much better way to set the Change date.

    Edit: Here's the link to go to the full explanation directly.

Similar Threads

  1. add/change fields in same record appearing in two forms attached to the same table
    By Rokrz in forum Alpha Five Version 9 - Desktop Applications
    Replies: 1
    Last Post: 03-04-2009, 11:52 AM
  2. Change and Add New record to same table
    By ChrisTeo in forum Alpha Five Version 5
    Replies: 12
    Last Post: 02-23-2008, 11:45 AM
  3. Did something change with date fields in the latest build?
    By Bill in forum Alpha Five Version 7
    Replies: 1
    Last Post: 05-31-2006, 10:49 AM
  4. add, change, delete record
    By JeffShaw in forum Alpha Five Version 5
    Replies: 1
    Last Post: 03-11-2003, 05:35 AM
  5. Add Date on Change Only
    By Nip Lewis in forum Alpha Five Version 4
    Replies: 8
    Last Post: 11-05-2000, 05:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •