I have been breaking my back on this one and just can't seem to figure out how to do this.
What I want to do is open up a database using C# and open up a form in the database with a specific filter that comes from C#.
This I got working perfectly with the code below:
Access.Application oAccess = new Access.Application();
oAccess.DoCmd.OpenForm("contacts", Access.AcFormView.acNormal, moMissing, "ID=2", Access.AcFormOpenDataMode.acFormPropertySettings ,Access.AcWindowMode.acWindowNormal, moMissing);
The problem I am having now is every time I run the code it opens the database again even when it is already open. Causing 2 instances of the same database open.
My question is: How do I check if the database is already opened, then if so, don't open it again, rather give the form a new filter condition and refresh the results.
Is this at all possible?
Thanks in advance