Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007

    Question Unanswered: Date Text Box Question


    I have a text box that i called "last updated"

    Well what I want this text box to do is display the "Current date" when a record in the data base was either changed, updated or edited in any way. For instance, if someone goes in and changes any field in my data if they change any entry in the record, i want the "current date" text box to display the date that they made the change.

    Right now you have to click on the form to get the date to change. How do I get the date to change ONLY when someone makes a record change.

    Where do I enter the code? What code?

    Thank you!

  2. #2
    Join Date
    Apr 2007
    Form's On Dirty Event comes to mind!

  3. #3
    Join Date
    Dec 2006
    Momence, IL USA
    Access doesn't do triggers. I think the only way you MIGHT be able to get the result you want is to watch for a change in the modified property (date/time) of the .MDB file. You can make a program in .Net that uses the System.IO.FileSystemWatcher object. Set the FileSystemWatcher object's EnableRaisingEvents property to True. It will fire a Modified event whenever that changes. But the modified date might also change whenever someone changes a form or runs a report or runs a select query. You would have to check all the current record values against a set of last known values. And if your checking fires the Modified event, well, it might cause some circular problem. I don't know, you'll have to check that out yourself. Anyway it definitely does fire when a record is modified.
    If you don't have .Net, there must be a windows api equivalent to the FileSystemWatcher, but I don't know what that is.
    Don't Bogart That Squishee!

  4. #4
    Join Date
    Oct 2007
    Thank you!!!!! It worked great.

  5. #5
    Join Date
    Nov 2007
    Adelaide, South Australia
    I just use a Before Update and set a field to Now(). Works fine for my needs.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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