I have a form from which I can Access 2 another forms. I can do that by clicking into selected record. What I want to do is prevent user to open second form in any different record that first form is allready opened. So far I have tried this (in Current event of 1st form - let me call It Main form):
If CurrentProject.AllForms("MySecondForm").IsLoaded And CurrentProject.AllForms("MyThirdForm").IsLoaded Then
If Forms![MySecondForm].Form![ID] = Forms![MyThirdForm].Form![ID] Then
'do nothing
Else
...
MsgBox "Error. You cannot open both forms in different records !"
End If
End If
Any ideas on which event I need to use code, and how to prevent that ?