Suggest me on how to write Lotus Script on Query mode

Hi ,

Suggest me on how to write Lotus Script on Query mode change event of the Form to check for specific [Adimistrator] role and the status of form as a saved document.

Thanks in Advance.