View Single Post
 
Old 04-07-2022, 04:50 AM
Debaser's Avatar
Debaser Debaser is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

You've already got End sprinkled throughout that code (yuk) that does what you need, so you could simply use that again. IMO there are very few situations where that is really the best option. I'd move the validation code into a separate function that returns True if the save happens and false otherwise, then you can call that from anywhere you need it rather than having to make events public just so that you can call their code directly rather than leaving them to respond to events as they are designed.
Reply With Quote