Hey, Chris.
When you edit an existing .frm file, InForm will attempt to preserve anything below the following line in your .bas file:
': Event procedures: ---------------------------------------------------------------
If it doesn't find that exact line, it will overwrite the existing .bas with an empty sketch again, while keeping a backup copy in the same folder, for safety.
That means that anything you have customised above said line will be removed when you save over.
One alternative is to only update the .frm file, in case your recent edits only involve the design and you didn't add/remove controls. That way, InForm doesn't need to touch the .bas and your SHARED variables remain intact. In the File menu choose "Save project as..." and check the box that says "Don't save .bas project (Save .frm only)":
[ This attachment cannot be displayed inline in 'Print Page' view ]
Hope that helps.