Value based on if ID is present in another table (1 Viewer)

Chumpalot

Registered User.
Local time
Today, 06:29
Joined
Mar 12, 2015
Messages
76
Hi all,

I'm in the process of creating a database that keeps track of tokens and has the ability to link these tokens to users.

I have two tables, tbl_users and tbl_tokens.

tbl_users.AssignedToken is a lookup to tbl_tokens.TokenNumber.

When a token is assigned to a user I would like tbl_token.TokenStatus to have a value of 'Assigned'. If the token isn't assigned I would like this value to be 'Unassigned'.

I haven't the foggiest on how I go about implementing this. Any advice would be greatly received.

Thanks
David
 

Minty

AWF VIP
Local time
Today, 06:29
Joined
Jul 26, 2013
Messages
10,371
If you have a field in tbl_tokens AssignedTo and store your UsersID then you don't need an assigned field. You know it's assigned because it has an assigned user ID.
 

Chumpalot

Registered User.
Local time
Today, 06:29
Joined
Mar 12, 2015
Messages
76
Thanks for the post Minty. This makes complete sense but I'm not sure on how to carry this out. Should I be using a lookup field?
 

Users who are viewing this thread

Top Bottom