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