473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Making 3 fields a primary key????

I'm in a crunch and can't remember how to do this....I have a table that has 3 fields - none of the fields will be unique by them selves, but if you put them all together they will create a unique #. I want to use that as the Primary Key in my table, but can't remember how to do it...I saw an earlier post but it didn't make sense to me. Do I need a separate field for the primary key? If so how do I set it up to import the data from the other three fields?
Oct 12 '06 #1
4 4505
Tanis
143 100+
I do NOT recommend composite keys. They tend to cause more problems then they are worth. I recommend using an autonumber as your primary key for all tables. If you want to enforce uniqueness on a combination of fields you can do that using a multi-field unique index. To create a composite key, open the Table in design view. To create a multifield Primary Key, ctrl-click each field that will be part of the key (so that they are all highlighted); then click the key icon.
Oct 12 '06 #2
I need to use the compsite because it's a shipping log. How do I get the primary key to display in the table?
Oct 12 '06 #3
KelHemp
16
I need to use the compsite because it's a shipping log. How do I get the primary key to display in the table?
what you might want to do is create a new column for "shipping log #" and set its control source to equal your three numbers in the order you want them to appear. You may need to have it be a text field instead of a number field, however.
Oct 26 '06 #4
You can highlight the fields you want to make the primary key in the table design view and then click the primary key button on the tool bar.

:-)

I need to use the compsite because it's a shipping log. How do I get the primary key to display in the table?
Oct 26 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Waqas | last post by:
Please see the detail of tables with fields in SQL server 2000. ·Table Student .Table Good Qualities ( It is a list of Students) (It is a list of Good Qualities)...
1
by: Simeon Nevel | last post by:
As a personal exercise, I'm trying to create a call tracking DB for my own use at work. Here's an abbreviated version of the database layout: Company: CompanyID - Primary Key (Text Length...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
0
by: Megan | last post by:
Hi Everybody- I know that this is a really, really long post, but I wanted to try to give you as much background as possible. So here's a quick overview of the issues I'm asking for help with:...
4
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
0
by: sramruttun | last post by:
hi In my database I have a table in which 3 fields make up the primary key. I use a datagrid to add, edit/update and delete entries of that table. To facilitate this work we often use the...
2
by: John | last post by:
I have two tables in a 1:M relationship- the parent has 5 fields in the primary key and the child 6 (these are actually pretty far downstream in a complicated ER model, but the problem is between...
1
by: jpatchak | last post by:
Hi Guys, Sorry if this is a really stupid question. I am trying to upsize my Access database to SQL server. When I used the Access upsizing wizard, some of my queries didn't get upsized so I am...
2
by: Tom_F | last post by:
To comp.databases.ms-access: In the VBA code behind a form, I would like to create a string variable, composed of the names of the field(s) in the primary key of the table which is the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.