Validation based on previous records

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • auxvivrespos@gmail.com

    Validation based on previous records

    I am using Access 2003 and I have built a simple little database to
    keep track of invoices that are received at my office. I have created
    a "Suppliers" table which is a list of the companies from whom I
    receive invoices and I have also created an "Invoices" table to record
    individual invoices. The "Invoices" table contains fields for the
    Date, Supplier (referenced from the "Suppliers" table), Tax, and
    Total.

    I recently realized I will need a way to ensure that I'm not entering
    the same invoice twice. My proposed solution is to modify the
    "Invoices" table to include an "InvoiceNum ber" field. This new field
    will allow me to record the the supplier's invoice number as it is
    printed on the invoice. This data field will be optional as not all
    invoices I receive include an invoice number. I have chosen to
    represent this number using a text field since each supplier's seems
    to use a different scheme for numbering their invoices and it could
    include the use of letters as well as numbers.

    The final step would be to create some sort of validation rule to
    disallow the entry of a record if it contains the same "Supplier" AND
    "InvoiceNum ber" data as those of a previously existing record.

    I'm not sure how to create a validation rule that is dependent upon
    data contained in previous records. Might anyone out there be able to
    steer me in the right direction?
Working...