Check handler has assigned to a single command.
If you mix two event in a single procedure, its logic gets complicated and decreases its stability.
Assign a handler for each event. If different actions are required in case of events in different form commands: - Create a separate procedure or a function that executes the required action. - Сreate a separate handler for each form item. - Call the required procedure or function from each handler.