Open Access form

aspfun

Active member
Joined
Feb 16, 2010
Messages
34
Programming Experience
5-10
I follow the instruction from
Automate Microsoft Office Access 2003 from Microsoft Visual Basic .NET
but got en error said

"The command or action 'OpenForm' isn't available now."

How to fix it? I used vs2008 and office 2003. Here is codes below.

Imports System.Data.OleDb
Imports Microsoft.Office.Interop.Access
Imports Microsoft.Office.Interop
...
Dim oAccess As Access.Application
oAccess = New Access.ApplicationClass
oAccess.DoCmd.OpenForm(FormName:="frmMain", View:=Access.AcFormView.acNormal)
 
I don't think you can open an Access Form outside of Access since all Access forms and reports are MDI children to Access itself and half the vba query keywords wont work outside of Access anyways.

I could be wrong, but it doesn't make sense to have a vb.net app show an Access DB form, I'd just re-create the form in vb.net and enjoy the greater flexibility.
 
Back
Top