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!

Using Docmd in an external access db

Status
Not open for further replies.

UHNSTrust

Technical User
Dec 2, 2003
262
GB
I want to be able to run this TransferText function in an external database that is not open.

DoCmd.TransferText acImportDelim, "MyImportSpec", _
"MyTableName", "C:\Txtfiles\April.doc"

I have a frontend that I want a user to be able to press a button and that will import a CSV's data into a table in another database.

Can anybody tell me if this is possible nad give me an idea as how to do it?

Thanks in advance

Jonathan
 
Have a look at the Workspaces collection in DAO. With Access you can have more than one database open at a time - only one in the GUI though, which wont be a problem for you because you don't want the other db to be visible.

Hope this helps.
 
Check out the Access.Application object:

Dim ac as Access.Application
ac.OpenCurrentDatabase("C:\some.mdb")
ac.DoCmd...
--Jim
 
...sorry you should say:
set ac = new access.application 'after the Dim
------------ or -----------
dim ac as new access.application 'in one shot
--Jim
 
Thanks for all the replies. Only just got back into work after leave. I have used Jim's suggestion and it works great.

Thanks to everybody who had a look at this.

Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top