I have a home movies database that I'm creating and am trying to prevent the user from entering duplicate star names. My initial thought was to simply make the star name field a PK, but I cant because if I do it breaks some of the relationships.
So, I'm curious if there's a semi-easy way to prevent the user from entering duplicate entries in a field that is not a PK?
My form, AddStars, allows the user to enter a new star name into the Stars table, but it does not prevent duplicate star names from being entered.
I'm thinking maybe with a query, but I dont know how to do this...
Heres the layout of my DB if it helps:
tblMovies (MovieID, MovieTitle, Media, Rating, Genre, Watched, Liked, Description, Notes)
tblStarsToMovies (StarID [FK], MovieID [FK])
tblStars (Name, StarID)
If I set the Name field in tblStars as a PK, I dont have.... well you see my dilema...
Help?
Ultimately I just need to prevent against duplicate actor names being entered.
So, I'm curious if there's a semi-easy way to prevent the user from entering duplicate entries in a field that is not a PK?
My form, AddStars, allows the user to enter a new star name into the Stars table, but it does not prevent duplicate star names from being entered.
I'm thinking maybe with a query, but I dont know how to do this...
Heres the layout of my DB if it helps:
tblMovies (MovieID, MovieTitle, Media, Rating, Genre, Watched, Liked, Description, Notes)
tblStarsToMovies (StarID [FK], MovieID [FK])
tblStars (Name, StarID)
If I set the Name field in tblStars as a PK, I dont have.... well you see my dilema...
Help?
Ultimately I just need to prevent against duplicate actor names being entered.
Last edited: