primary keys

jacks

Registered User.
Local time
Today, 23:59
Joined
Jun 3, 2007
Messages
28
I have two tables :

schema with :

schema-id, Autonumber, primary key
name, text

and a table regel :

regel-id, Autonumber
class a, number (lookup from a table)
class b, number (lookup from a table)
schema-id, Long number

they are linked 1:n. A schema can have many regel's.


I want to make a form of schema and have that form contain a subform with regel's in it. The subform can be shown as a datagrid.

Now here's what I do.. I start the form wizard and select both tables. The wizard takes me to creating what I want and it works too. I have a main form schema and a subform with regel's.

Now I have a problem :

The regel fields (class a and class b) can have only three possible values. And I don't want that the combination of these two fields can be the same.

I'v thought about making these two fields the primary keys of regel, but that doesn't work. It works for one record of schema, but when I navigate to a next record of schema, I can't make all combinations of class a and class b over again. It's like I used the combinations in the preceding record of scheme. Then I tried making three fields the primary key, namely class a and class b and regel-id. Didn't work either. What I need is a primary key on the combination of schema-id, class a and class b. But I don't know how to do that.. after all, schema and regel are seperate tables.

I want to be able to make for every schema record all possible combinations for regel records.

How do I do that ?
 
Last edited:
Open the table in design view. Highlight the three fields holding down the Ctrl key. Click the key symbol on the tool bar.
 
Open the table in design view. Highlight the three fields holding down the Ctrl key. Click the key symbol on the tool bar.

hm. Your explanation is not very helpful.. With this text you'r not helping out. Just making me look silly. But thanks for replying as you'r the only one.

I figured it out myself... and indeed.. I have to make class a and class b and the "foreign" key schema-id in the table regel the primary key. And then I have exactly what I need.. and it works as desired now.

That's what counts.
 
hm. Your explanation is not very helpful.. With this text you'r not helping out. Just making me look silly. But thanks for replying as you'r the only one.
I think being snotty about it isn't a good response. He gave you the exact steps to create a composite key. Now, if you had said, "I'm sorry but I'm still not getting what you are telling me." That would have been appropriate and maybe one of us would provide screenshots.
 
jacks - is your question that you are trying to create a compound key...

or that you want to generate combinations of values in multiple separate records automatically as a result of some (or no) action on your part...

or a third goal that I missed completely?

No disrespect intended, but your post betrays that USA/British English is not your primary language. Or if it is, then you have an odd way of describing what you wanted. Unfortunately, your word order is a bit confusing and that perhaps is the reason you are getting so few responses.
 
jacks - is your question that you are trying to create a compound key...

or that you want to generate combinations of values in multiple separate records automatically as a result of some (or no) action on your part...

or a third goal that I missed completely?

No disrespect intended, but your post betrays that USA/British English is not your primary language. Or if it is, then you have an odd way of describing what you wanted. Unfortunately, your word order is a bit confusing and that perhaps is the reason you are getting so few responses.

English is not my native language. And the help I get in this forum is great. I'm really grateful for any help that I receive here. Thank you all for that.
 
jacks - is your question that you are trying to create a compound key...

or that you want to generate combinations of values in multiple separate records automatically as a result of some (or no) action on your part...

or a third goal that I missed completely?

No disrespect intended, but your post betrays that USA/British English is not your primary language. Or if it is, then you have an odd way of describing what you wanted. Unfortunately, your word order is a bit confusing and that perhaps is the reason you are getting so few responses.

yes. I think it's called a compound key that I had to create. It's working now. I just had the key members wrong. But it's clear now.
 
yes. I think it's called a compound key that I had to create. It's working now. I just had the key members wrong. But it's clear now.
I am always happy to help and I do understand the misunderstandings that can arise, even between two people that have the same first language!

I certainly did not want to make you look silly. I guess my posting could have been better phrased, but I thought you needed a compound key and just described how to create one. Your posting seemed to show a good understanding of the issues and I assumed you just wanted a push in the right direction.
 

Users who are viewing this thread

Back
Top Bottom