ghh3rd
01-29-2008, 11:48 AM
I'm trying to figure out how to link a text file to my database with VBA. I know how to do this for other types of data sources, using the DoCmd.TransferDatabase acLink command, but need guidance using this with TXT files.
Thanks,
Randy
Guus2005
01-31-2008, 11:48 PM
You need to use docmd.transfertext, but first you do it manually and save the specification.
Left click in the database window and choose link table.
Select your textfile.
click the button advanced
alter the settings you need.
save the specification (remember the name)
continue to the end.
Now you have created a specification in your database to read this specific textfile.
You can use the docmd.transfertext method and enter the specification name you just created to lnk the tekstfile using code.
Enjoy!