Create a Primary key in a Query

Swifey

Active Member
Joined
Jan 16, 2003
Messages
421
Is it possible within a query design view to create a table with a primary key?

The reason why I ask is that when I update my table queries I have to delete my relationships between my tables created in a query design view.

As you can appreciate indexing can cut down the processing time by half.

Kind regards
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,452
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Hi
Can you explain what it is you are trying to do? What are the queries doing?
Andrew
 
Upvote 0

Swifey

Active Member
Joined
Jan 16, 2003
Messages
421
Within a query design view I create a table to another users database which contains customer sales figures.

The users links other tables which contain primary keys on cusno.to the one I create. If they create a relationship it stops me from refreshing there data.
 
Upvote 0

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,452
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Unless I'm misunderstanding the set-up, can you create the table in your database and have the other users links their databases to yours? They would have a linked table in their database and as you add data to the table in your database, the data would appear in their database without any need to change / delete the relationships.
Andrew
 
Upvote 0

Swifey

Active Member
Joined
Jan 16, 2003
Messages
421
ADVERTISEMENT
My database is used for other things
 
Upvote 0

pritcham

Board Regular
Joined
Oct 26, 2005
Messages
128
Hi

Is it possible/practical for you to update your query definition(s) through VBA using the querydef object?

Martin
 
Upvote 0

Forum statistics

Threads
1,195,945
Messages
6,012,445
Members
441,701
Latest member
vnkendijs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top