Add a primary key via a macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi - I am stuck. I have a macro that uploads text files via the "transfer
text" action. I
saved the import specification that I need and all works well EXCEPT for the
primary key. I selected "Let Access add primary key", but it doesn't add it
when I run the macro. When I upload the file by hand and select the import
specification, the primary key is inserted. But when I run it via the macro,
it isn't. What can I do to get primary keys added without having to upload
each file by hand?
 
Hi - I am stuck. I have a macro that uploads text files via the "transfer
text" action. I
saved the import specification that I need and all works well EXCEPT for the
primary key. I selected "Let Access add primary key", but it doesn't add it
when I run the macro. When I upload the file by hand and select the import
specification, the primary key is inserted. But when I run it via the macro,
it isn't. What can I do to get primary keys added without having to upload
each file by hand?

Are the files all of the same structure - fields and datatypes? What are you
uploading them into: separate tables?

I wonder if it might make more sense to have a single table set up, with an
autonumber primary key; and import the files *into* this table. You could have
an additional field to indicate which file was the source of the data; link to
the files and run Append queries to import the data.

John W. Vinson [MVP]
 
Back
Top