The Stoat
The Grim Squeaker
- Local time
- Today, 12:38
- Joined
- May 26, 2004
- Messages
- 239
Hi,
I don’t want this to descend into an argument over the use of natural or surrogate keys. If you put a search into Google you can find hundreds of such discussions, it’s been done to death.
I’m actually interested in the way(s) in which Access allows you to implement surrogate keys – most often in the form of auto-number fields or GUID’s – and the considerations that must take place when doing so. I think it will prove enlightening.
The following example is for illustration purposes and is deliberately kept simple.
A medical consultant runs an outpatient clinic everyday between 9am and 12pm. This table would allow us to record the Clinic information.
ClinicID GUID
ClinicSpecialtyID GUID FK from TBL_SPECIALTY i.e. Ophthalmology
ConsultantID GUID FK from TBL_CONSULTANT
ClinicDate DATE
The Business model tells us that a consultant cannot be running more than one clinic at one time.
The question is: How do you implement in Access constraints on the fields within the tables to prevent the input of duplicate data.
What I’m asking for is the specific actions and methodology i.e. if you say “ I’d add an index”, how exactly with pictures for preference
, if you say “I’d do this in code with a select query” please explain the reasoning.
TS
I don’t want this to descend into an argument over the use of natural or surrogate keys. If you put a search into Google you can find hundreds of such discussions, it’s been done to death.
I’m actually interested in the way(s) in which Access allows you to implement surrogate keys – most often in the form of auto-number fields or GUID’s – and the considerations that must take place when doing so. I think it will prove enlightening.
The following example is for illustration purposes and is deliberately kept simple.
A medical consultant runs an outpatient clinic everyday between 9am and 12pm. This table would allow us to record the Clinic information.
ClinicID GUID
ClinicSpecialtyID GUID FK from TBL_SPECIALTY i.e. Ophthalmology
ConsultantID GUID FK from TBL_CONSULTANT
ClinicDate DATE
The Business model tells us that a consultant cannot be running more than one clinic at one time.
The question is: How do you implement in Access constraints on the fields within the tables to prevent the input of duplicate data.
What I’m asking for is the specific actions and methodology i.e. if you say “ I’d add an index”, how exactly with pictures for preference

TS
Last edited: