PC Review


Reply
Thread Tools Rate Thread

How can I allow only one record per category?

 
 
Rachel Garrett
Guest
Posts: n/a
 
      11th Aug 2011
Greetings,

Suppose I have a database with a category for Region, and the
possibilities are North, South, East, and West. (I might want to add
regions in the future, and some tables will have more than one record
per region, so Region needs to be its own column rather than having
columns for North, South, East, and West individually.)

Now let's say that there are some tables that use Region, where I want
to allow only one record for North, one record for South, one for
East, and one for West.

What is the best way to accomplish this?

Thanks,
Rachel
 
Reply With Quote
 
 
 
 
XPS350
Guest
Posts: n/a
 
      11th Aug 2011
Put all the data in one table and make Region the primary key of that table.

Peter
http://access.xps350.com/
 
Reply With Quote
 
Access Developer
Guest
Posts: n/a
 
      12th Aug 2011
In the table in which you want only one record per region, index the Region
column, and, in the properties, specify "no duplicates".

As XPS350 said, if you make Region a Primary Key, it will be indexed with no
duplicates allowed, but it is not _necessary_ that Region be the Primary
Key, only with properties as I described.

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access


"Rachel Garrett" <(E-Mail Removed)> wrote in message
news:1ade8bf2-4746-44e4-924f-(E-Mail Removed)...
> Greetings,
>
> Suppose I have a database with a category for Region, and the
> possibilities are North, South, East, and West. (I might want to add
> regions in the future, and some tables will have more than one record
> per region, so Region needs to be its own column rather than having
> columns for North, South, East, and West individually.)
>
> Now let's say that there are some tables that use Region, where I want
> to allow only one record for North, one record for South, one for
> East, and one for West.
>
> What is the best way to accomplish this?
>
> Thanks,
> Rachel



 
Reply With Quote
 
Rachel Garrett
Guest
Posts: n/a
 
      19th Aug 2011
On Aug 12, 1:51*pm, "Access Developer" <accde...@gmail.com> wrote:
> In the table in which you want only one record per region, index the Region
> column, and, in the properties, specify "no duplicates".
>
> As XPS350 said, if you make Region a Primary Key, it will be indexed withno
> duplicates allowed, but it is not _necessary_ that Region be the Primary
> Key, only with properties as I described.


Thanks; I'll use this.

--Rachel
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Send response based on category rule; auto remove category? tish Microsoft Outlook VBA Programming 3 31st Oct 2008 07:04 PM
Assign price category based on multiple record criteria hepsedam@gmail.com Microsoft Access 9 16th Oct 2008 08:31 PM
Filter / Lookup: Display record on new sheet based on category... MeatLightning Microsoft Excel Misc 1 14th Apr 2008 12:58 AM
Open Form in last Category or record =?Utf-8?B?bG12?= Microsoft Access 24 3rd Jan 2006 08:23 PM
I only have one category for a record, but keep getting error tha. =?Utf-8?B?cmljaGVsbGVseW5u?= Microsoft Outlook BCM 0 26th Apr 2005 07:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 PM.