Results 1 to 6 of 6
  1. #1
    smitstev is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    4

    Validation Rule

    Hi All,



    I am creating a database which is used by multiple people. I want to create a validation rule in the table that will not allow data to be entered if the date of the data is already contained in the data.

    The validation rule must find the newest(most current) date in the data and not allow any date of that and older.

    Does anyone have a solution for this. I have been searching forever...

    Any help would be greatly apprciated! Thanks!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You need to do this in the BeforeUpdate event of a control on a form.

  3. #3
    smitstev is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    4
    I need to do it in a form...? I am trying to write the rule for a table.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your needs exceed the abilities of validation at the table level. Your users should never see the tables directly anyway. All Edit/Add/Delete operations on tables should be through forms.

  5. #5
    smitstev is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    4
    The database is only being used by me and one other person... we just want to make sure we do not import the same days data twice.

    Could I just use two tables, one as a master table and one as a temp table. Have a query that moves the data into the master table where the date is not equal?


    Thanks!

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If the dates are unique then you could UPDATE Where Not IN as an append. Remember that Access DateTime fields include the time as well.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Referencing table data in field validation rule
    By toad848 in forum Database Design
    Replies: 3
    Last Post: 03-19-2009, 07:03 AM
  2. Data Validation - Please help
    By larry S in forum Access
    Replies: 0
    Last Post: 11-16-2008, 10:24 PM
  3. Validation Rule: Date
    By krymer in forum Access
    Replies: 0
    Last Post: 08-27-2008, 03:30 PM
  4. Validation Rule
    By mistaken_myst in forum Database Design
    Replies: 2
    Last Post: 10-29-2007, 02:08 PM
  5. Validation rule for a text field
    By wasim_sono in forum Forms
    Replies: 4
    Last Post: 03-14-2006, 11:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums