View Full Version : Importing text File to BackEnd using Front End VBA


ions
09-18-2006, 09:36 PM
Dear Access/VBA Expert.

I would like to run the TransferText commands below (See Code) on the db (BackEnd) object. Is this Possible?

If not I've come up with a less effecient solution. Do the transferText here in the FrontEnd and then use TransferDatabase method to copy it to the backend. Then delete it in the front end. But I think this will bloat the front end way too much.

******************** Start of Code ****************
Dim db As Database
Set db = DBEngine.OpenDatabase("C:\Aimco\AimcoBackEnd.mdb")

'**I want to run these two DoCmd.TransferText on the db (backEnd)****

DoCmd.TransferText acImportDelim, "HWINGenerators Import Specification", "HWINGenerators", "c:\HWIN\HWINGenerators.txt"

DoCmd.TransferText acImportDelim, "HWINWasteClasses Import Specification", "HWINWasteClasses", "c:\HWIN\HWINWasteClasses.txt"

db.Close
Set db = Nothing