This code stops a Form from being opened from the Navigation Pane. This Code prevents the user from opening a Form from the navigation pane. This is necessary if you have developed a Form which should only be open from another Form. In other words, a Form that passes information back to the Form that opened it.
The terms I use for these type of Forms are “Call Called” as in you have a Form which is “Called” (the one you are opening) and you have the Form that is being opened, that’s the “Called” Form >>> Call — Called.
Live Link for the Code below:- https://msdn.microsoft.com/en-us/library/office/ff196795.aspx