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

DAO Connection ?

Status
Not open for further replies.

lizI3

Programmer
Jul 2, 2002
31
0
0
CA
I have a shortcut on my desktop with the following code

"C:\Program Files\Microsoft Office\Office\msaccess.exe" Q:\VersDataLink.mdb /wrkgrp Q:\DataLink.mdw

I wanted to create a new Access 97 DB with a form that would have command buttons so that a user could click on and open another access 97 db one of which would be the above, but I cannot get the code to work. I have tried Open database method but cannot get the above code to work. I get error 91 and database = nothing.

Could anyone point me in the correct direction I am lost
Do I need to use DAO if so how does that work?

Thanks
Liz
 
i have this code in a button to open another database. you would need to change the path of the program to i think it's Office9.

Dim path As String, program As String, transferdb As String

program = Chr$(34) & "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" & Chr$(34)
path = " " & Chr$(34) & "C:\Documents and Settings\DC04116\Desktop\Database Examples\Replace Files.mdb" & Chr$(34)
transferdb = program & path

Call Shell(transferdb, vbMaximizedFocus)
 
Thanks Drctx, but I cannot get the code to work. Iam still a newbie at theis and I don't understand the Chr$(34)

When I click my button I get File not found and the Call Shell is highlited

Liz :(
 
Chr$(34) is the code to print the double quote ".

can you post your code and i'll see if i can see the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top