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

Import Automation and...

P: n/a
I have deployed an app in the app is a form that imports all files in a directory. Stores the files as tables with the tablename as the filename. Works great! I would like to take this one step further in that certain files contain different variations of a larger group for example a group is EB33. My function now would import the file and I would have a table name EB33.

In that file can contain two different variables of that call them EB33A and EB33b. Right now I would have to eventually create a seperate table for each. I would like to make two tables from that one import EB33A and "B". Meanwhile I still have mutliple files to import. Here is the code I am currently using for importing all files.

Private Sub Command0_Click()

'procedure to import all files in a directory and delete them.
'assumes they are all the correct format for an ASCII delimited import.
Dim strfile As String
Dim tblName As String

ChDir ("c:\Email_Promo\Lists")
strfile = Dir("*.csv")
Do While Len(strfile) > 0

'table name same as file name without ext
tblName = Left(strfile, (InStr(1, strfile, ".") - 1))

DoCmd.TransferText acImportDelim, "ImportFiles", tblName, strfile, True

strfile = Dir
Loop

End Sub

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.