473,491 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

primary key on two fields

107 New Member
Hello,
I have an access database w/one table- one form.
I want to make first two fields have primary key. I select them in design view of table and use primary key icon.
But it is not working like I thought it should.
field1- ONE field2-DATE
If I enter same data in ONE and different data in DATE- I thought it should it should allow me- It does not.
I thought It would only stop me if I tried entering same data in both fields.Could the DATE field be a problem? or is that not how to do this?

Is there a way to do this?
Thank you
Apr 14 '07 #1
3 2097
ADezii
8,834 Recognized Expert Expert
Hello,
I have an access database w/one table- one form.
I want to make first two fields have primary key. I select them in design view of table and use primary key icon.
But it is not working like I thought it should.
field1- ONE field2-DATE
If I enter same data in ONE and different data in DATE- I thought it should it should allow me- It does not.
I thought It would only stop me if I tried entering same data in both fields.Could the DATE field be a problem? or is that not how to do this?

Is there a way to do this?
Thank you
What you are referring to is a Composit Primary Key (Primary Key conisting of Multiple Fields) and this is the easiest way to create one:
  • Select the Table to contain the Primary Key ==> Design View
  • Select View ==> Toolbars ==> Table Design
  • Select your Fields that will make up this Composite Key by holding down the CTRL Key and clicking on the Fields
  • On the Table Design Toolbar, click on the Primary Key button (it is between the UNDO and Indexes button)
  • Good luck
Apr 15 '07 #2
buddyr
107 New Member
thank you
Not sure what I was doing wrong - works fine now
Apr 15 '07 #3
ADezii
8,834 Recognized Expert Expert
thank you
Not sure what I was doing wrong - works fine now
Glad to help.
Apr 15 '07 #4

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

Similar topics

6
3561
by: John Simmons | last post by:
How is it that even though I have the column "username" in my database set as a Primary key, using my PHP script to add new users to the database works without any errors even when signing up using...
4
10540
by: serge | last post by:
I ran into a table that is used a lot. Well less than 100,000 records. Maybe not a lot of records but i believe this table is used often. The table has 26 fields, 9 indexes but no Primary Key at...
7
5332
by: Philip | last post by:
Hey all, (Access 2000) I've been having a horror story with this design problem. My Database is Structured like This: AUTHORS, BOOKS, PAGES. Those are the Tables and each Item in each table...
14
10098
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
18
12616
by: Thomas A. Anderson | last post by:
I am a bit confused in creating a composite primary key. I have three table with two of the tables containing primary keys. I have two of the tables (each with a primary key) having one to many...
2
8657
by: Brad | last post by:
Thanks for taking the time to read my question. I have code that I am using to tell me info about fields in a table. It is in a loop so I can move through all the fields in the table. ...
2
2235
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
1837
by: GGerard | last post by:
Hello I'm trying to find the best way to set indexes and primary keys on MSAccess tables What are the advantages and disadvantages of indexes and primary keys? What fields should be indexed?...
8
31511
by: Paul Hunter | last post by:
I am new to databases and thus to Access. I have a situation where I am trying to figure out how to key some tables I am working with. Consider that I have a database of my own records which are...
9
3888
by: sonal | last post by:
Hi all, I hv started with python just recently... and have been assigned to make an utility which would be used for data validations... In short we take up various comma separated data files for...
0
7115
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
6978
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
7154
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,...
1
6858
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
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.