Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Multi-field PK in Newly-Made Table 1

Status
Not open for further replies.

milcman

Programmer
Dec 19, 2002
31
0
0
US
I am pulling data from 2 separate A2k2 databases over our corporate network. Both DB structures are identical (excepting data). I accomplish this by using a make table query to pull data from one DB, then an append query to pull data from the other DB, for each table. I use this data for weekly reporting purposes. I know it's not the best way to set it up, but I just found some other ways to do this tonight in this forum, which I will attempt to implement at a later date. The thing that I am trying to do is to set a two field primary key programatically in the tables that consists of the record ID (EX: atoWells_ID)and the region name (Ex: strTechLocation). I am wanting to do this so I can run reports combining data from the five tables that the DB has.

All suggestions greatly appreciated!

Clint Galliano
Halliburton Energy Services
BAROID PSL
"Done ONCE, Done RIGHT!"
 
Something like this ?
DoCmd.RunSQL "CREATE INDEX myPK ON myTable (atoWells_ID,strTechLocation) WITH PRIMARY;"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks, PH! That hooked me up. Have a STAR!

Clint Galliano
Halliburton Energy Services
BAROID PSL
"Done ONCE, Done RIGHT!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top