Double-saving == NOnoNO!!

  • Thread starter Thread starter LaZy
  • Start date Start date
L

LaZy

Guest
I'm really having truble with this one:
I have a registration for roadtrips, and I have the tables "roadtrip" and "participator" that are important now. All participators are given their own <customernr>, and all trips are given a <tripnr>, thoose are autonumbers, and are primary key's.
And in a table called "participation" I connect the <customernr> and the <tripnr>, and I want to disable the possibility to save a <customernr> twice with the same <tripnr>. But still; a costumer needs to be able to goto more than one trip, just not the same trip twice.. plz help. Thanx in advance!
Regards,
|-LaZy-
 
make the key for the participation table a multiple key (<customernr> and <tripnr> ) and set allow duplicates to No.

hth,
al
 
Well, how exactly am I gonna do that?
I poked around for a bit, but didnt quite get where and how I would make such a key, multiple. I'm sorry if I seem like such a n00b now, but I cant figure it out..

|-LaZy-
 
you go into the design view of the table, hi-light both columns, then press the primary key button and you get a multi column primary key for that table.
 
That worked, but not in the way I wanted it..
Cuz now, each field can only be used one time. ie: the tripnr 1, can npot be used to reg more than one "participation", same goes for the customernr.

I'm confused ;o)
 
oops. think i lead you astray...forget the No Duplicates part! set both fields to indexed no. then select both fields and right click and select Primary key.
sorry
frown.gif


check Help under: multiple-field primary keys for more info...

hth,
al




[This message has been edited by pcs (edited 12-13-2001).]
 
Well, again, this is what what I'm looking for. And example: If customernr 1 goes to the tripnr 4, its obvious that he can never goto tripnr 4 agian, cuz even if its the same route onother time its given another tripnr. So I need some sort of check to see if the trippnr-customernr relation has been used before, and if yes, alert that its not possible to reg it again. With your solutions all they do is that it impossible to use the same tripnr/customernr twice, regardless of if its the same user or not. Remember: One user has to goto as many trips as he want, and a trip has to be used by as many users as nessisary, but NEVER one user on the same tripnr twice. You get what I'm trying to do now? Its cinda hard to explain, but I hope this made things clearer...
 
think you need to post the fields in your tables...

al
 

Users who are viewing this thread

Back
Top Bottom