Yeah, I’ve got Win7Pro with an XP VM so that I can run my stuff in 2003 until I have time (hah!) to get them ported over. I’ve got LOTS of VBA code to fix. I’ve stalled on this for what, nearly half a decade now? But I really don’t have a choice - the entire org is switching over to 2007/2010, and my customers are tired of not having it when everyone else does.
Johnny, I’m working from the assumption that you can’t do anything about the creation/formatting of your initial files (either because they’re from an outside source, or because it would be too difficult to fix in that system).
And I’m figuring that you’re using Excel for the clean up either because you’re more familiar with Excel and/or because Access doesn’t always play well with quotation marks. It’s entirely probable that you could set up Access to do the whole process, if you want to. I’ve got numerous Access processes that do just this sort of thing for people.
But for now, Imma leave that alone.
I do wonder why you are exporting the Excel files to csv and then importing those to Access, though. Why not just import the Excel files directly into Access?
At any rate, the first thing you should do is set up some file specifications. Even if you decide not to use macros, this will reduce the work you have to do each month.
Pick one of your files to import, and go through the process of setting up the import. Once you have the Field Names and Data Types set, click the Advanced button down in the bottom left corner.
This opens up the Import Specification box. If you look over the fields, you’ll see that it’s mostly just a different view of the stuff you’ve already set like the field and text delimiters, datatypes and indexes, etc. You can do all your settings in this box instead of the usual display, if you want. For instance, it can be easier sometimes to just scroll down the Data Type column and set everything to TEXT rather than clicking through the columns in the GUI.
Once you have everything set up correctly, click the Save As button and name the new specifications something that makes sense. If you’re going to work towards automation, use underscores (_) rather than spaces, it will make things easier later. Click OK when you’re done, and OK again to get out of the Import Specs box.
Voila! Now, any time you want to import that type of file, just click the Advanced button as soon as it appears, then click the Specs button to get your list of saved specifications. Select the File Specification for that file and click Open. All of the setting choices you made are automatically applied to the current file. You can just click Next through the wizard until you get to that key page and select your Primary Key.
The import specs are saved inside this particular database, so you won’t see them elsewhere - although you can import them into a different database if needed.
Now, do the same thing for your Export files.
Access 2010 also comes up after you finish an import/export and asks if you want to save settings. I would imagine that it’s doing something similar to this process - but I have not used it and can’t confirm that.
Let me know if you have any questions.
Give this part a try and then, if you’re interested, I’ll walk you through setting up a macro to automate your process.