Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009

    Unanswered: Display an error message if value does not exist in a different table

    I am just starting out on MS access and would some help getting going.

    I have 2 tables "tbl_Paint" and "tbl_Production". “tbl_Paint” has field "Paint_no".” tbl_Production” has “Paint_no_doors” and “Paint_no_windows” which are linked to “Paint_no” in relationships.

    A form is available for inputing paint notes. (frm_paint_notes_input)
    Another form is available for inputting Production information. (frm_production_input)

    On frm_production_input form you can entre 2 paint note numbers (“Paint_no_doors” and “Paint_no_windows”)

    I want the database to display an error message if the paint note entered in “frm_production_input.Paint_no_doors” or “frm_production_input.Paint_no_windows” does not exist in “tbl_Paint. Paint_no”
    I hope this all makes sence and any help will be much appreciated.

  2. #2
    Join Date
    Feb 2004
    Chicago, IL
    I am not sure I fully understand. If you want to make sure the user only enters data that already exists in a table, then I put a combo box on the form and limit it to the values in the table (property Limit To List). So that the user cannot choose something that is not already in the table.

    You can also accomplish this with Relationships also. Create a relationship between the tables and Enforce Referential Integrity. That way when the user tries to save a record that does not have an appropriate number it will not save it. The problem with this approach is the error may not be as obvious to the user.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts