I'm cleaning up the code in some projects, doing things like moving Me.Close to Finally when both the Try & Catch end by closing the form.

Theoretically, this project should probably run from a Sub Main but it's built with a user login form as the startup form-so everything runs from that form & when it closes the application ends. I'll try to summarize the code:

Code:
Try
   If Invalid_Password Then
      Me.Close
   End If
   Me.Hide
   NextForm.ShowDialog
Catch
   Show_Error
Finally
   Me.Close
End Try
Now, my question is if the password is invalid will it try to close the form twice & if so will it cause a problem? If not then what would be the best way to handle this? (Other than eliminating the Finally block & ending both Try & Catch with Me.Close)

I could, I suppose, put Me.Hide & ShowDialog in an Else clause but there's considerable code in between that I left out in the summary. I don't know about you, but personally I hate IF/Else blocks with more than 5-10 lines of code.

Thanks.