Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating tables automatically

Status
Not open for further replies.

Lazza123

Technical User
Nov 19, 2001
5
0
0
AU
Hi all,

im doing a database system for the sports association at my uni. wat i want to do is that whenever a person makes a payment, it will automatically updata a yes/no box in another table. does anyone know how to do this?

thnx

lazza
 
It is considered bad practice to have a field's value be dependent on another field's value when that field is not the primary key. It is better to simply "calculate" the desired result. In this case you need only determine that a payment has been made for any given individual when such payment meets specific criteria. Then, based on this, you can use an unbound field to state this fact.
 
OK, i wont do it like that..

now another problem is that, how do u handle multivalued primary key attributes??

right now i have tables players, players teams, and teams

i have a player who can be on many different teams, but not all players will be on more than one team.

right now ive got players pk and teams pk in player teams. plater teams has player id, team 1, team 2, team 3...

it then becomes difficult to handle payments received for each team..

any idea on a good strucutre to solve this?



 
This is a many to many structure. You'll need an intermediate table to create the join. This table needs foreign key links to the primary key of each table (teams and members). You should probably make these two fields a compound primary key, but don't try to use it as your actual linking keys to the payment transaction table. Instead create a pseudo primary key using an autonumber field. Use this as your join field just as though it were the actual primary key field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top