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

Access function problems

Status
Not open for further replies.

labanTek

Instructor
Dec 3, 2004
37
Hi can you tell me why the following code does not open my database? I placed this code in the Onclick event of a command button.
Thanks in advance.

Dim myAccess As Access.Application
Set myAccess = CreateObject(, "Access.Application")
myAccess.OpenCurrentDatabase ("C:\koykoy.mdb")
 
Probably that you try to pass the path as the second arguement to the CreateObject function. The class is supposed to be the first arguement (which is more like how you'd use the GetObject function, I think).

[tt]Set myAccess = CreateObject("Access.Application")[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top