1 Reply Latest reply on Aug 4, 2011 9:15 AM by philmodjunk

    Date Modified + IF Statements with Dates



      Date Modified + IF Statements with Dates



      I programmed a database and am running into difficulty coding an IF statement that notifies the user when they are writing over an exisiting record.

      Statement of Problem: Users of database are writing over pre-existing records.

      Solution: Use an IF + Date statement that pops-up when a user is about to change a record with an earlier date stamp. Give the user to continue editing record or create a new record.

      I am not sure if this is the best way to attack the problem. Any suggestions are welcomed.



        • 1. Re: Date Modified + IF Statements with Dates

          I'm thinking of a bit different approach here.

          Define a serial number field, onCommitSNField, and specify that the value be entered "on Commit". Then this field will store a value only if the record was previously committed (saved).

          Then you can use OnObjectEnter on each and every field for which the layout/security settings allow editing to perform this script:

          If [ YourTable::onCommitSNField]
             Show Custom Dialog ["You are changing an existing record"]
             If [ Get ( LastMessageChoice ) = 2 // cancel was clicked ]
                 Go To Object [ "put object name of button here to keep cursor out of data field"]
             End If
          End IF

          Note that it is also possible to use record level access controls set up in Manage | Security to control which users may be allowed to edit existing records. See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a detailed description of how to set this up.