If I have a command button that I want to bring up a form that was designed in Access, what code to I write for it. The Access database is saved on my desktop.
The only way to do this is to create an instance of Access through your program.
Here is some code:
Code:
Dim AccApp As Access.Application
Set AccApp = New Access.Application
With AccApp
.OpenCurrentDatabase dbPath
.DoCmd.OpenForm "FormName"
End With
you will need to add a reference to Microsoft Access x.0 Object Library under the Projects..., References Menu
I doubt that this is what you're wanting to do but it is really the only way to use an access form through VB,,, i've tried several things without success,,,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.