The DoCmd.OpenForm Function of Access COM

  • Thread starter Thread starter BadStorm
  • Start date Start date
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
 
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.
 
Back
Top