Indeterminate Relationship

Ollie_3670

Registered User.
Local time
Today, 00:42
Joined
Feb 1, 2010
Messages
50
Hello All!

Just started to make a database to register students and their applications to a university and already I've managed to hit a brick wall.

Apparently my ApplicationHeader and my ApplicationLine table cannot be joined because the relationship is indeterminate. One Application Header can hold several "Application Lines" (one for each course applied to) so the relationship should in fact be a 1:M.

I'm going to go ahead and state I believe it's a problem with the primary keys, but I don't know how to work around it as I believe the primary keys are correct.

(A student can only submit one applicationHeader per year)

The error message received is "No unique reference found for the referenced field in the primary table"

Thanks for your help in advance!
 

Attachments

Application_ID was my guess?
 
That guess is correct. It worked for me. Are you linking via the Relationships or via Lookup Wizard?
 
I've clicked on:

Database Tools -> relationships

Then highlighted Application_ID in TblApplicationHeader then dragged over to Applicaton_ID in TblApplicationLine

The box popped up, I tick "enforce ref. integ." then try to click OK

---

Is there an alternative way?
 

Attachments

  • InderterminateRelationship.jpg
    InderterminateRelationship.jpg
    94.3 KB · Views: 434
Using the table on the right of your relationships diagram, go to design view of the form. In the ApplicationID field, under data type select Lookup Wizard, just follow the prompts. Try that and tell me the outcome
 
In TblApplicationHeader, go to design view, select Application_ID and look at the Indexed property. Set that to Yes(No Duplicates). That should solve your referential integrity problem.
 
Just tried it and it simply creates another indeterminate relationship! :mad:

Oh wait, didn't see your second post, I'll just try that now
 
YES! It worked, fantastic!

Any reason why it was set to "Duplicates OK"? Was that me clicking something by mistake or just something I have to be aware of whilst using compound PK's?

Thanks again! :D
 
Great job. One piece of advice though, I think Application_LineID should be autonumber. As for ApplicationID it should also be autonumber unless you have specific numbers which you wish to input into that field?
 
I'd agree entirely, just waiting for my client to make a decision on whether she wants information from her current system brought over, or left there!

Going off topic slightly, but it only needs a straightforward answer. Is there a simple way to be able to use Auto number generating a random number? Instead of a sequential number

Thanks for everything!
 
Not really. Autonumber only produces its numbers in sequence. It's not adviceable using a random number as your unique idea because there's a possibity of it generating that same number at some point causing a duplicate record or an error (if your table structure doesn't permit this). If you're still interested, here's a link with examples of creating a random number using functions:

http://www.martin2k.co.uk/vb6/tips/vb_27.php
 

Users who are viewing this thread

Back
Top Bottom