X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Opening Access    
post Jul 17 2002, 10:11 AM

Posts: 52
Joined: 20-December 00
From: Newark, Nottinghamshire, England

I am trying to open an access database using vba in Excel. I have seen a previous message asking for the same thing and have based my code on this...
im appAccess As Access.Application
Dim db As Object
Dim rs As Object
Private Sub CommandButton1_Click()

Set appAccess = CreateObject("Access.Application")

Set db = appAccess.DBEngine.OpenDatabase("C:\My Documents\Database.mdb")
End Sub
...however, I get the error message "Compile Error: User-Defined type not defined" and "appAccess As Access.Application" bit of the code is highlighted.
What am I doing wrong?
Any help appreciated,
Go to the top of the page
post Jul 17 2002, 11:05 AM

Posts: 48
Joined: 1-November 00
From: Englewood, Florida USA

In your Code Editor....click on Tools, then References....click the check box that reads 'Microsoft Access 9.0 object Library'...then compile.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    20th July 2019 - 05:03 PM