Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Forms in VB

Status
Not open for further replies.

eelsar

Technical User
May 20, 2002
36
US
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.

Thank you!
 
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,,,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top