Import from text doc

  • Thread starter Thread starter Access Intermediate
  • Start date Start date
A

Access Intermediate

I have a text doc that is updated each week and is
imported to one of my tables via a macro. Is there a way
to search to see if this text doc has updated the table to
prevent duplicates? Also, to prevent this from happening
is there a way to automate this procedure instead of
clicking a button? Any suggestions would be greatly
appreciated.
 
Could you link it instead of importing it? That way it
would always be the most current information.
 
That would probably do it, but this text doc changes each
week and is used to append the tables. Do you possibly
have any other alternatives?
 
Can you set one of your fields as a unique index so that
attempting to import the same records twice would result
in an error? If that's not an option, you could start
your macro off with some VBA code that would open the
import file, read the first line, and then do a search in
your table to see if it's already there, and if so, abort.
 
I see where you are going with, but one of my tables has
over 2 million records. That could take a while. If I
have a form with a button to run the macro and append the
tables. Is there a way to check when the button was
pressed and to check when the text file was created? If I
create a text field on the form where I can place the date
and if the date is older than input date then run macro
else cancel event. Would this make sense?

Thanks for the input so far
 
Checking dates should work. You could actually just have
a seperate table with a field that would update each time
you clicked your import button. Then you'd need some VBA
code that would compare that date with the date the file
was created to determine whether or not to run the
import. Are you familiar with VBA coding?
 
Yes, I can probably do this without any problems. I was
just trying to get some suggestions on how to tackle this.

Thanks for your responses
 
Back
Top