The DoCmd.OpenForm Function of Access COM

B

BadStorm

Hi,
I have a C# program that need to open two Access mde Forms. I use this
code:

oAccess = new Access.ApplicationClass();
oAccess.OpenCurrentDatabase(
Path.GetDirectoryName(Application.ExecutablePath) +
"\\Test.mde", true //Exclusive );

and then that code to open the Form


oAccess.DoCmd.OpenForm(
"Contacts",
Access.AcFormView.acNormal,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
Access.AcFormOpenDataMode.acFormPropertySettings,
Access.AcWindowMode.acDialog,
System.Reflection.Missing.Value
);

The first problem is that the Access Form appears below the C# Form and the
second problem is that when I open the Access Form, this "block" my
application until i close the Access Form, and I cannot open the second
Access Form simultaneously.
I tried the Thread with no success.

Any suggestions?

Thanks

Marco
 
J

Jeff Johnson

oAccess.DoCmd.OpenForm(
"Contacts",
Access.AcFormView.acNormal,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
Access.AcFormOpenDataMode.acFormPropertySettings,
Access.AcWindowMode.acDialog,
System.Reflection.Missing.Value
);

The first problem is that the Access Form appears below the C# Form and
the second problem is that when I open the Access Form, this "block" my
application until i close the Access Form, and I cannot open the second
Access Form simultaneously.
I tried the Thread with no success.

Any suggestions?

The acDialog value is what is preventing you from opening the second window,
I'm almost positive. It probably opens the form modally.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top