Create an import template without a primary key.

G

Guest

How do I create an import template without an automatic primary key created?
When I create my template to bring in a text file that is comma seperated, I
created the template and saved it, but when I click finish, the table is
created and has an auto generated ID field. Did I miss somewhere that I can
tell it not to create the autoID and save that as part of the import
template? I know if you go step by step through the process, you can tell it
not to create the ID field. I want to be able to use this template as part of
an automatic process running from within a macro. Also how do I run it from a
macro? I see there is an Action - RunCommand with the property of Import but
has no other properties to select the template I wish to use or point to a
file to import.
Thanks in advance
Kenny A.
 
V

Van T. Dinh

Somewhere in the Import Text Wizard dialogs (which you used to create the
Import Specification), probably the 3rd or 4th dialog box, you have the
option of getting Access to generate the PrimaryKey Field ID or not.

To automate with Macros, use the TransferText Macro action.
 
G

Guest

Van,
Thanks for replying. I know (as I mentioned in my original post) in the
wizard you can turn off the option to auto gen an ID field, but that does not
seem to get saved with the template. The template saved the field names and
size, type of field, but not the option of turning off auto gen of the ID
field. If I manually import the file and select the template, yes I can walk
through rest of steps to turn off auto gen of ID field, but if this is going
to run automatically, I will not have that option. So, again I ask, how to I
turn off this option and save as part of template that will run
automatically?
Thanks
Kenny A.
 
V

Van T. Dinh

In the TransferText Macro or TransferText Method (VBA), you have an option
to specify the Import Specification you want to use for the import.

Check carefully Access Help (Macro) / Avvess VB Help (Method) and you will
see this option, argument.
 
G

Guest

Thanks Van, I will look into.
Have a nice day

Van T. Dinh said:
In the TransferText Macro or TransferText Method (VBA), you have an option
to specify the Import Specification you want to use for the import.

Check carefully Access Help (Macro) / Avvess VB Help (Method) and you will
see this option, argument.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top