Retain Boolean variable after closing and opening the form


I have a form with table as data source.

In the data source write() method, I am assigning true value to Boolean variable when user added the new record

I have another button in the same form. Now I want retain that Boolean value until user clicked that particular button.

User may close the form and open it again but I want to retain the same value till user clicked the that button.

Kindly suggest if anybody has an Idea