Navigation Pane Stopper

This code stops a form from being opened from the Navigation Pane. This form prevents the user from opening the 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 opening it and that’s the “Call” form >>> Call Called.
Private Sub Form_Open(Cancel As Integer)
'Application.CurrentObjectName Property (Access)
'HERE:-
'https://msdn.microsoft.com/en-us/library/office/ff196795.aspx
Dim strCurrentName As String
strCurrentName = Application.CurrentObjectName
    If strCurrentName = Me.Name Then
        Cancel = True
        Exit Sub
    End If
End Sub 'Form_Open
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn