Results 1 to 2 of 2
  1. #1
    JoeyHenry is offline Novice
    Windows Vista Access 2007
    Join Date
    Feb 2013
    Posts
    1

    Validation Rules in the Forms

    Hi,

    I am new to access and VBA. I need to have a validation rule after the user hit "enter" on one my forms. The purpose of this database is to record claims. Please see attachment for further visual on how I designed the database.

    Background:

    1. There are three main tables and forms: DTASA, CMRF, CM
    2. For one DTASA there could be claims (CMRF). For one claim, there could be many credit memos (CM).

    Validation Rule:

    1. After the enduser enters the amount in the CMRF form, access should then validate whether the claims (both previous and current) is greater than the DTASA amount.
    2. If the sum of the CMRF is greater than the DTASA amount, an error message should alert the enduser "Claims greater than DTASA".
    3. If the sum of the CMRF is lesser than the DTASA amount, the end user should be able to continue the process.

    Please help how we can code this in VBA or some other easier techniques for this validation rule.

    Regards,
    Joey
    Attached Thumbnails Attached Thumbnails Picture.JPG  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    In the Amount textbox BeforeUpdate event Something like:

    If DSum("Amount", "tablename", "CMRF=" & Me.CMRF_ID) + Me.Amount > Me.DTASA_ID Then
    MsgBox "Claims greater than DTASA"
    Cancel = True
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-09-2012, 07:54 PM
  2. Field rules/validation rules
    By sk88 in forum Access
    Replies: 14
    Last Post: 02-26-2012, 01:03 PM
  3. Multiple Validation Rules
    By Theremin_Ohio in forum Access
    Replies: 1
    Last Post: 12-16-2011, 01:21 PM
  4. troubles with validation rules
    By focosi in forum Access
    Replies: 4
    Last Post: 08-02-2011, 10:46 AM
  5. Validation Rules
    By esglover in forum Database Design
    Replies: 1
    Last Post: 07-23-2010, 08:02 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