View Full Version : Import txt file and Check dates


shark70
11-23-2004, 08:30 AM
I need to set up a macro that will import a daily ORDERS text file with data for the Columns below. I have set up a delete query to run before the daily file gets imported
Business Date Subscription SubStatusCode EntitlementCode NumberOfSubscriptions Currency


I then need to append this file to a historic file (on a daily basis) but only if the Business Day is greater than the Maximum Business day on the Historic file.
I also need to bring an error message up if the imported file Business day already exists

Is it possible to do all this in 1 macro

I haven't done much with macroes so any help is greatly appreciated

Thanks
Shark70

reclusivemonkey
12-03-2004, 07:55 AM
Firstly, you can do a lot without using macros here. Do you need to import the text file each day? Can't you just link to the text file? Then you can skip having to import, just append the data. Filter your append query if you want to exclude certain items. If you want an error message to come up you will need to run a macro, but do you definitely need the error message? If you haven't done much with macros, I would do as much as you possibly can without them to reduce brainache!

trucktime
12-03-2004, 09:19 AM
Of course I don't know the ins and outs of your project, but wouldn't it be better to put the daily orders in the database directly, instead of using a text file. It seem you could save a a lot of headache and when the data is in the mdb you can manipulate it anyway you want.

Trucktime

debbiepy
12-04-2004, 09:49 AM
I import a text file into Access using a spec. In the spec, I created a new field that is not in the original text file called DateModified. After I import the text file, I want to update the filed to todays date i.e. using the NOW()

I am trying to add a command to my macro, that transferst eh text file, to input this date in all the records but I cannot seem to figure it out. Any help out there? You can email me directly if it is easier. Debbiepy@comcast.net

Debbie

reclusivemonkey
12-06-2004, 02:01 AM
Can you post the code for your macro debbie? Again, you can use an update query for this, and you can trigger that from your macro.