benkingery
Registered User.
- Local time
- Today, 00:28
- Joined
- Jul 15, 2008
- Messages
- 153
I have a situation where I'd like to import multiple files into an access database. Most of the VBA I'm okay with, I'm just new to using loops, so I'm hoping someone has a good ability to help me with looping this function.
I'd like to start out by opening a dialog box that allows the user to open a file, like this:
Pretty easy... After this first function runs, I'd like to ask the user if there are any additional files to be imported. If the answer is "Yes" then I'd like to do this very same thing again. If the answer is no, then I'd like to proceed to my next step and end the loop.
Any help is greatly appreciated.
Thanks in advance.
I'd like to start out by opening a dialog box that allows the user to open a file, like this:
Code:
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
dlgOpen.InitialFileName = "Y:\Access Databases\Import Files to CRM DB\CSN"
dlgOpen.Show
DoCmd.TransferText acImportDelim, "CSSalesTransactions", "ORDERS_CSN_OrderBuffer", dlgOpen.SelectedItems(1)
Pretty easy... After this first function runs, I'd like to ask the user if there are any additional files to be imported. If the answer is "Yes" then I'd like to do this very same thing again. If the answer is no, then I'd like to proceed to my next step and end the loop.
Any help is greatly appreciated.
Thanks in advance.