I made this code to let my user open up my database and see a report. It prints the report, then it will open the access database. I know I'm doing something wrong, i just want to view the reprot called student history. Any advice or corrections tomy code would be helpful. I'm using visual basic 6.0.

Dim OApp

Set OApp = CreateObject("Access.Application")

OApp.Visible = True


'path to the database
dbstr = "C:\Documents and Settings\William\My Documents\seminar\senior seminar\Main Program\MiniEconomy database\minieconomy.mdb"


OApp.OpenCurrentDatabase dbstr

OApp.DoCmd.OpenReport "StudentHistory", acViewPreview, , , acDialog

OApp.DoCmd.Maximize

Hi
I am not having knowledge about this. but u can use

Choose Project -> Reference -> Microsoft Access 11.0 Object Library (For MS Office 2003)
or Microsoft Access 12.0 Object Library (For MS Office 2007)

Now the object library is added to your project

So u can get the Quick List
Or u can use Object Browser (F2) and u can view all the objects properties, method and events.

This will be helpful for u.

Convert the code like this

Dim OApp as Access.Application

Set OApp = New Access.Application
OApp.Visible = True

Is this a vb component i'm adding??

I didn't have to change the source vode at all. The refenerce was all that was wrong. Thank you for your advice.

This question has already been answered. Start a new discussion instead.