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

open an access db in access the application not IE

Status
Not open for further replies.

229257

Programmer
Apr 23, 2002
54
GB
I have used these following pieces of code to open up documents from our intranet but not within the browser with the application they were written. e.g open a word document in the app word not within IE.

The code for Excel is:

Sub cmdorders_OnClick

Set objXL = CreateObject("EXCEL.application")
objXL.Visible = True

' ADD a workbook
objXL.WorkBooks.Open("H:\USERS\FIN_BELITD\Purchase Orders\ITorders.xls")

End Sub

The code for Word is:

Sub cmdword1_OnClick

Set objword = CreateObject("WORD.application")
objword.Visible = True

' Open .doc
objword.Documents.Open("H:\USERS\FIN_BELITD\Purchase Orders\ITorders.doc")

End Sub

What i want to know is how do i do the same for an access database?? I have tried the following code:

Sub cmdhardware_OnClick

Set objACC = CreateObject("ACCESS.application")
objACC.Visible = True

' Open a db
objACC.databases.Open("H:\GRPAPPS\Hardware\db1.mdb")
End Sub

This works up until 'objACC.databases.open' i have guessed with this and have tried a couple of variations with the 'databases' part what is the correct name you put here??? or am i completely on the wrong track? Any suggestions would be greatly appreciated!
 
Hi 229257,

Try
Code:
objACC.OpenCurrentDatabase("H:\GRPAPPS\Hardware\db1.mdb")
.

Or
Code:
objACC.OpenCurrentDatabase "H:\GRPAPPS\Hardware\db1.mdb"
.

HTH [smile]
mikey2nicey
"Dream, but don't quit your day job."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top