The method doesn't work? I tried opening the form from the navigation pane and I could. This is what I did. Imagine I have 2 forms called Main and UserInfo. The form UserInfo cannot be seen by all the users, so if he tries opening it through the navigation pane, he should get an error.
So in the code to open the UserInfo form I wrote this code:
Code:
DoCmd.OpenForm "UserInfo", OpenArgs:= Me.Name
and in the open event of the UserInfo form, I used the code:
Code:
If Me.OpenArgs = vbNullString Then
MsgBox "You must open the form from Main form"
DoCmd.Close acForm, Me.Name, acSaveNo
End If
But I can still open the UserInfo form from the navigation pane