Results 1 to 3 of 3

Thread: Constraints

  1. #1
    Join Date
    Dec 2004

    Question Unanswered: Constraints

    I hope someone can help me on this?

    I am using MS Access 2000 and have a table with three fields:

    TaskID - Autonumber - Key Field
    Task - Text
    TaskNote - Memo

    I currently have it with the Task as Indexed with No Duplicates. So a task "Check Terminals" would only be allowed to be listed once.

    I want it to be able to accept duplicate tasks, but only if the Notes are different

    Task - "Check Terminals" TaskNote - Null
    Task - "Check Terminals" TaskNote - "Main Battery"
    Task - "Check Terminals" TaskNote - "Secondary Battery"

    would be allowed, but I would not be able to put in a task of "Check Termainals" again without adding a note that is different to the notes already there.

    I hope that I can add a constraint to the table, but I don't know if this is possible, and if it is how I do it.

    Many thanks

  2. #2
    Join Date
    Jul 2003
    Access doesn't have constraints on tables like SQL Server. The best way to do this is to do your data entry through an unbound form, and validate the data before saving it.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Jul 2004
    The table shouldn't have any constraints at all. This comes in at the input form level.

    The task combobox (if you use one) would have the recordsource of SELECT DISTINCT Task FROM TableName;

    This will then only give you a list of each task type. From there your notes field would just be a text box.

Posting Permissions

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