procedure ...
didn't work.
Do you mean that clicking again on the tabsheet did not invoke the procedure, or that the procedure did not accomplish what you intended?
If the former, then look again at how you have arranged for the procedure to be called, and why it might fail to be called when you expect.
If the latter, you'll have to show some code, and what you hoped it would do, but failed to do.