View Full Version : Import Txt file Macro


shark70
11-19-2004, 06:33 AM
I need to set up a macro that will import a text file with data for the Columns below.
The text file (pipe delimited) will be daily and won't have any headers

Business Date Subscription SubStatusCode EntitlementCode NumberOfSubscriptions Currency

Make that 2 macroes

I need the first one to be a daily file with figures for just one day and I also need to set up one that appends all the data
I also need a check in place so it doesn't import data the same data (same date)

Can anyone help please?

Thanks
Shark70

Emmanuel
11-19-2004, 10:17 AM
Shark70,

In this case mt recomendation would be to use not only a macro but a query that can limit the amount of data you want to import and then a macro that feeds that information to the destination table.

I have a few questions:

1-Will you be importing data to a table?

If this is the case you need to use a transfer text macro but first keep in mind that you need to creat the query which will restrics data to just today or the specific date you need.

2-Do you need to tie this "macro" to a button?

If so I would recomend the use of a button wizard after you create the macro so it would tie to the button on the form.


Good luck,

Emmanuel

shark70
11-21-2004, 10:11 AM
Hi Emmanuel

Yes I will be importing the data to a table. . .does this mean the date query would be a part of the transfer text macro or do I run the query first.

Yes, I will be using a button on a form

Cheers
Shark70

Emmanuel
11-29-2004, 04:49 AM
Hi,

You would need to run the query first and then create the transfer text macro that reads from the results of the query. If you want better results I recommend that the query be a make table query and then do the macro from that table. The reason for this is that if you leave it as a regular query it could take long but it would still do the job.

Good Luck!

Emmanuel
DBA Brighthouse Networks