A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating non-PK unique constraints in Access 2003



 
 
Thread Tools Display Modes
  #1  
Old July 20th, 2008, 05:45 PM posted to microsoft.public.access.tablesdbdesign
[email protected]
external usenet poster
 
Posts: 1
Default Creating non-PK unique constraints in Access 2003

I need my PK to be a single field so that I can establish parent-child
relationships. Therefore I create an autonum field at the top of my
table, and designate that as my PK.

I also need a composite uniqueness constraint on two of the real
fields in the table. I can't seem to find a good step-by-step for
making this non-PK constraint. I can get to the indexes dialog box,
but I've tried a couple things, and none of them seem to resuly in a
constraint. Can someone walk me through it?
  #2  
Old July 20th, 2008, 05:58 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Creating non-PK unique constraints in Access 2003

1. In the indexes dialog, click in the first blank row, and enter a name for
the index and the first field

2. In the lower pane set the Unique property to Yes.

3. On the next row of the dialog, leave the index name blank.
This indicates to Access that this row is part of the previous index.

As a silly example, the dialog might look like this when you create a unique
index on the combination of Surname + FirstName:

SurnameFirstName Surname
FirstName

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
...
I need my PK to be a single field so that I can establish parent-child
relationships. Therefore I create an autonum field at the top of my
table, and designate that as my PK.

I also need a composite uniqueness constraint on two of the real
fields in the table. I can't seem to find a good step-by-step for
making this non-PK constraint. I can get to the indexes dialog box,
but I've tried a couple things, and none of them seem to resuly in a
constraint. Can someone walk me through it?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.