Results 1 to 4 of 4
  1. #1
    NewbieNinja is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    2

    How to create a validation rule to make sure that one field is not greater than another field.

    Hello, everyone!

    Please forgive my noobness I am a college student who has just completed Introduction to MS Access course at my local community college. I was asked by a friend of mine to make a small Access DB that would store client information. In the process of creating this DB, I ran into a small problem. What I need is to create a validation rule so that the Account Balance field can only be subtracted if the Payment field is equal to or less than the Account Balance field. I have tried a bunch of different steps but I keep getting error messages. Any suggestions?

  2. #2
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,422
    You should not be storing calculations in tables. Where you away that day, or are they not teaching this most basic precept?
    In a case like this, aggregate (math) functions should be performed on the sum of all values in a field vs the sum of another field, and this should be done on a form. You would test if txtBalance exceeds txtPayment before processing the payment. Not sure why you'd want this rule anyway. Is it not possible that someone would accidentally make a payment twice or a payment that exceeds the balance? Surely I am not the only one who has ever done that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    NewbieNinja is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    2
    I was technically never absent. The course was online and all the homework we did was out of a book. The professor wasn't that great either. Never answering emails and tests that had nothing to do with the material we covered from week to week. But... I am rambling about my issues. This is AccessForums.net, not Dr. Phil. Thanks for the information.

  4. #4
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,422
    Well, we will try our best here to be supplemental instructors! Post back if you need more information.

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

Similar Threads

  1. Replies: 2
    Last Post: 06-09-2016, 04:18 AM
  2. Field Validation Rule based on another field
    By yako966 in forum Database Design
    Replies: 3
    Last Post: 02-18-2016, 09:06 AM
  3. Validation Rule in Multi Value Field
    By lima in forum Access
    Replies: 3
    Last Post: 10-14-2014, 12:14 PM
  4. Validation rule for a month field
    By Alliana Gray in forum Access
    Replies: 7
    Last Post: 08-11-2011, 12:41 PM
  5. Validation rule for a text field
    By wasim_sono in forum Forms
    Replies: 4
    Last Post: 03-14-2006, 11:39 PM

Tags for this Thread

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