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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Access From Reflections VBA

Status
Not open for further replies.

cfcanter

Technical User
Sep 12, 2001
31
US
I am trying to open and manipulate an MS Access Database from Reflections VBA. I have included the MS Access 9.0 Object Library in the "Tools References". The following code compiles but does not open MS Access or the database I need.

Sub RunAccess()
' written by C. Canter 22-MAR-2002
' initialize string to database path
Dim appAccess As Access.Application
Const strConPathToSlow = "C:\slow_move\Slow.mdb"
strDB = strConPathToSlow & "Slow.mdb"
'Create new instance of Microsoft Access
Set appAccess = CreateObject("Access.Application")
'open database in MS Access Window
appAccess.OpenCurrentDatabase strConPathToSlow
appAccess.DoCmd.OpenTable "table1"
End Sub

I've copied it right out of the MS Access help manual so it should be ok. The path and database exist on the C:\ drive.

Any suggestions? Craig Canter
Cost Accountant
Sipex
Milpitas, CA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top