Alpha Video Training
Results 1 to 9 of 9

Thread: Auto updating date field

  1. #1
    Renae Rogers
    Guest

    Default Auto updating date field

    I would like to have a date field in my database that automatically updates to the current date when you make a change to a record - without having to physically enter the date field for it to change. Is this possible?

    OR do you have to actually enter the field during your change in order for it to update? If so, how do I make it do this then?

    Renae Rogers

  2. #2
    "Certified" Alphaholic Melvin Davidson's Avatar
    Real Name
    Melvin Davidson
    Join Date
    Apr 2000
    Location
    Parker, CO
    Posts
    1,197

    Default RE: Auto updating date field

    Renae,

    The best way is to edit the field rules for the database,
    select events, Record events and attach a script to the record changed event that would update the date field with the value of DATE().

    Your welcome :)
    Melvin

  3. #3
    Renae Rogers
    Guest

    Default RE: Auto updating date field

    I've not done any scripting before so what exactly do I type in the script box?

    Sorry to sound like a dummy!

    Renae

  4. #4
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default RE: Auto updating date field



    Renae:
    Open the database that contains the date field. Click on the field rules tab. Now click on the events tab and select record events as shown. Great, now select the 'changing the record' event from the drop-down list.
    Type in, as shown:
    databasename->datefieldname = date()
    In my example, HDVISIT is the database name, and
    visit_date is the field.
    There's points if you can figure out what the HD
    stands for!!!
    Hopefully, the picture comes out OK! [;
    Craig

  5. #5
    "Certified" Alphaholic Melvin Davidson's Avatar
    Real Name
    Melvin Davidson
    Join Date
    Apr 2000
    Location
    Parker, CO
    Posts
    1,197

    Default RE: Auto updating date field

    Craig,

    Since it was my suggestion, I want a chance at the points.
    I'm guessing HD stands for Health Department. If I''m right, send me the points by email. :)

    Melvin

  6. #6
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default RE: Auto updating date field

    Melvin:

    Sorry, no points this round. Would you like to try for double jeopardy and earn twice as many points. Perhaps I could sell you a vowel?

    I guess the reason I'm playing with this is, that you can never tell just how big the names are which are associated with using Alpha Software!

    I find myself looking at every computer, whether at the insurance agent, or at Macy's, wondering if the database engine behind it is A4 or A5!

    Anyway, It was a good guess, Health Department. They do make visits...

    Craig

  7. #7
    Renae Rogers
    Guest

    Default RE: Auto updating date field

    ACE! It worked. Thanks guys for your help. I've been using Alpha for years but am a newcomer to the messageboard - now I could kick myself for not looking at it before.

    HD - hhmmm? Health Department was a pretty good guess but I'll lock in Head of Department.

    By the way, do you know if there's a way of seeing a trial version of the latest Alpha 5 package? Just looking at what's on the website, it looks very different to the version I'm on.

    Cheers :)

    Renae

  8. #8
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    690

    Default RE: Auto updating date field

    Renae:

    If you are just starting to use Xbasic, NOW is the time to convert over to A5V4.5!

    A 30 trial version is available on WWW.ZDNET.COM:

    http://www.zdnet.com/downloads/stories/info/0,,001G1G,.html

    It is about 14 megabytes and will take a while to download (+/- 1 hour), unless you have a cable modem, DSL, etc...

    Sorry, Head of Department is an incorrect answer.

    Craig

    PS Welcome to the board!

  9. #9
    "Certified" Alphaholic Melvin Davidson's Avatar
    Real Name
    Melvin Davidson
    Join Date
    Apr 2000
    Location
    Parker, CO
    Posts
    1,197

    Default RE: Auto updating date field

    Renae,

    Glad to help! Craig is right. Now is the time to upgrade to A5. I've enjoyed A5v1.02 for many years, but it took me a while to catch on to the v4.5 version. It should be easier for you, since you won't have to "unlearn" some things.

    Good luck,
    Melvin

Similar Threads

  1. Field Not Updating?
    By seidel1 in forum Web Application Server v6
    Replies: 1
    Last Post: 09-09-2004, 01:29 PM
  2. Auto Auto-Increment Field
    By Ken McEntee in forum Alpha Five Version 5
    Replies: 8
    Last Post: 05-12-2004, 01:12 PM
  3. Updating an auto increment field
    By Don Hutchinson in forum Alpha Five Version 4
    Replies: 3
    Last Post: 10-21-2002, 08:11 AM
  4. Auto-updating drop down list?
    By Matthew Wilson in forum Alpha Five Version 4
    Replies: 6
    Last Post: 05-16-2002, 01:48 PM
  5. auto-filling in the date
    By Donnie Mayes in forum Alpha Five Version 4
    Replies: 4
    Last Post: 01-31-2002, 03:24 PM

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
  •