validate data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mark77m
    New Member
    • Mar 2008
    • 2

    #1

    validate data

    Hi all I have a question that I cant seem to find an answer to.

    I am fairly sure this will be an easy one. I have two tables in Access. One is current employees, one is termed employees. I want to set up a rule to where if I try to type in an SSN of a new employee in the current employees table and it already exsists in the termed employees table it will not allow the entry. Any suggestions?
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hi, Mark.

    What is a special reason to deal with 2 tables instead of one?
    It seems that reading aboutDatabase Normalization and Table structures would be useful for you.

    Kind regards,
    Fish.

    Comment

    • mark77m
      New Member
      • Mar 2008
      • 2

      #3
      Well I have two tables one for teminated employees which we need to keep and one for current employees. When I put a SSN into the active employees table if that entry is already there access will not allow the entry becasue its the primary key. I want to be able to do the same thing but check the SSN against the terminated table while entering it into the active table.

      Comment

      • FishVal
        Recognized Expert Specialist
        • Jun 2007
        • 2656

        #4
        Hi, Mark.

        You certainly may do it the way you like but this way it will be more complicated and less reliable to prevent record duplication.
        A general approach is to have an additional field in a table, let us say it is boolean and set to True or False indicating whether employee is current or "teminated" (? ;)). Or it may be a lookup field to indicate more possible statuses. This way you may create an index on [Employee SSN] field or make it PK.
        There is no need and nothing suitable in two separate tables.

        Regards,
        Fish

        Comment

        Working...