Results 1 to 9 of 9
  1. #1
    confidego is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    8

    Validation Rule Help!

    Hi guys,

    Under my table, I need to set a validation rule that checks for 'Delivery Date' to be after 'Order Date'

    I tried [Delivery Date]>[Order Date] and it does not seem to work. I received an error from the system 'Invaild SQL syntax - cannot use multiple columns in a column level CHECK constraint'

    I would like to seek out advice on how I can solve this problem? Attached is my table.

    Thank you.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Someone may correct me here but this level of validation should be done at the Form level and not the table level.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I agree with Allan. Here's an example:

    http://www.baldyweb.com/BeforeUpdate.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    confidego is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    8
    Hi guys, thank you for your replies.

    Does it mean, I absolutely cannot do it at Table level? My tutor once told me that it is possible.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I thought MS had added table level triggers of some sort in ac2010 but I can not seem to find them.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    In the immortal words of Ed McMahon, "You are correct sir":

    http://blogs.office.com/b/microsoft-...-triggers.aspx
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That explains why I couldn't find them. I never think of macros.
    Maybe they would be able to accomplish what the OP is looking for. I know nothing about them and would not be of much help in that event.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Could be, though I'm in a similar boat. I played with 2010 at a couple of Summits and during the beta, but I don't have it loaded on anything right now. I'm still using 2007 (and 2000 ) for production apps. I'm not a strong user of validation rules, but I wonder if:

    >[Order Date]

    would work.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You cannot use a validation rule where:

    • You want to call user-defined functions, or VBA functions beyond the ones in JET such as IIf() and Date().
    • The user should be able to bypass the rule.
    • The expression is too complex.
    • The expression involves data in other records or other tables. (Well, not easily, anyway.)

    From:
    http://allenbrowne.com/ValidationRule.html

    As was suggested above your data entry is really the place you want to perform the validation.

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

Similar Threads

  1. Validation Rule
    By ritzzy in forum Access
    Replies: 1
    Last Post: 04-13-2011, 01:33 PM
  2. Help with validation rule
    By Desstro in forum Programming
    Replies: 5
    Last Post: 02-27-2011, 08:05 PM
  3. Validation Rule
    By Megan in forum Access
    Replies: 1
    Last Post: 11-05-2010, 09:45 AM
  4. Validation Rule
    By Christopher in forum Forms
    Replies: 15
    Last Post: 04-20-2010, 06:05 AM
  5. Validation Rule
    By robomose in forum Access
    Replies: 1
    Last Post: 09-09-2009, 05:59 AM

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