Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How to Log Date when a Checkbox was checked


This topic is 7169 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

For the sake of argument lets assume you want the checkbox to set the Date field to the current date. Create a Value List named something like SetCurrentDate with the only value being "Y" (without the quotes). Next create a script called SetCurrentDate:

If [MyTable::MyCheckBox ; "Y"]

-Set Field[MyTable::MyCheckBox ; ""]

-Set Field[MyTable::MyDate ; ""]

Else

- Set Field[MyTable::MyCheckBox ; "Y"]

- Set Field[MyTable::MyDate ; Get(CurrentDate)]

End If

Then set the Field Format for you checkbox to "Check Box Set", Display Values from SetCurrentDate. Set your checkbox field to a button to perform script SetCurrentDate.

*Edit: I re-read your post and maybe you want this value stored in a related table to track all changes to the checkbox?

Posted

Make your date field an auto-enter calc with the following calc:

Case (not IsEmpty (your checkbox field) ; Get (Currentdate) )

This will always enter the date when someone checks the checkbox. When they uncheck it, it removes the date.

Posted

Right, never even thought about the auto-enter calc. A little more straight forward might be - If(IsEmpty(CheckBox);"";Get(CurrentDate))

Posted

If(IsEmpty(CheckBox);"";Get(CurrentDate))

You don't need the null result with vs. 7.

We don't know what the checkbox 'on' represents. It might be a 1 toggle. I always have a 'Select' value list which simply contains a 1 so I can use the same value list for many on/off toggles on fields.

If using a 1, all you need is:

If(Checkbox; Get(CurrentDate))

On that Auto-Enter calculation - if you want the current date to appear when checked but disappear when unchecked, you must remember to unclick the checkbox below the Auto-Enter by Calculation that says, "Do Not Replace Existing Value." If you want the date last checked to remain, leave this clicked.

This topic is 7169 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.