By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

More question on Data Auto Import (??)

P: n/a
Dan
I tried the following code to import a series of data files into an
Access table, but i keep getting Syntax errors. I'm running it from a
Macro using the RunCode action with the ImportFiles() function. Can
someone give me a pointer on how to correct this. Thanks in advance.

Code:
Function ImportFiles()
Dim strPath As String
Dim strFile As String

strPath = "C:\Database\"
strFile = Dir$(strPath & "*.txt")
Do While Len(strFile) > 0
TransferText (acImportDelim, "SampleData3import", "MyTable",
strFile, True)
\\i tried with DoCmd.TransferText as well, with no luck

strFile
strFile = Dir$
Loop
End Function
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Dan" <da*******@hotmail.com> skrev i melding
news:11*************************@posting.google.co m...
I tried the following code to import a series of data files into an
Access table, but i keep getting Syntax errors. I'm running it from a
Macro using the RunCode action with the ImportFiles() function. Can
someone give me a pointer on how to correct this. Thanks in advance.

Code:
Function ImportFiles()
Dim strPath As String
Dim strFile As String

strPath = "C:\Database\"
strFile = Dir$(strPath & "*.txt")
Do While Len(strFile) > 0
TransferText (acImportDelim, "SampleData3import", "MyTable",
strFile, True)
\\i tried with DoCmd.TransferText as well, with no luck

strFile
strFile = Dir$
Loop
End Function


Hi
Download textimport.exe
http://support.microsoft.com/default...NoWebContent=1
with samples of how to do this.

Sigurd
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.