470,594 Members | 1,401 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Import Automation and...

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

End Sub

Message posted via http://www.accessmonster.com
Nov 13 '05 #1
0 1194

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Santa-D | last post: by
10 posts views Thread by Niklas | last post: by
2 posts views Thread by madeleine | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.