question about a make table query and setting a primary key

  • Thread starter Thread starter King Kaos
  • Start date Start date
K

King Kaos

I have a query that makes a table - can I set the property of that table to
have a primary key? if so how

Thanks


Keith King
 
I have a query that makes a table - can I set the property of that table to
have a primary key? if so how

No, you cannot - not in a MakeTable query.

Note that MakeTable queries are VERY rarely necessary; just about
anything you can do with a Table can be done with less overhead using
a Select Query: forms, reports, exports, further queries...

What you would need to do is *either* run a DDL (Data Definition
Language) query to create the table, followed by an Append query; or
write some VBA code to create a primary key for the table after it's
been created (and trap the errors which will happen if the candidate
primary key is not in fact unique).

John W. Vinson[MVP]
 
Thanks - I wont waste my time with this

I have through of a few different way to complete this project - this was
just one avenue. I appreciate the assistance, you guys are alway helpful

Keith
 
Back
Top