Results 1 to 5 of 5
  1. #1
    maratkz is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    8

    How to set limits in forms

    We have a database of a shop where customers can accumulate and use points to buy stuff. I've created the Order form to add new orders however struggle with one part where customers you input how many points a customer wants to redeem. We tried to use the conditional restriction that you can find in the Property sheet but it does not work...


    The point is if there is a typo by an employee and the redeeming points are 100 and he/she inputs 1000 by mistakes how can we prevent this from happening? Please help

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Your logic should include something along these lines:

    How many points does this Customer have "in the bank"? Let's call that PointsAvail
    How many points does this Customer wish to redeem with this purchase? Let's call that PointsToRedeem

    You need to ensure that PointsToRedeem are <= PointsAvail and
    PointsToRedeem are <=PurchaseTotal.
    You do the check after the data is entered, but before the transaction is completed and the Invoice/Bill is presented.

    You could also have a confirmation message based on the PointsToRedeem number.

  3. #3
    maratkz is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    8
    Where do I input that? Is there any tricky slot? I do the same with data validation rule in the property sheet and it does not work...

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I would do it with vba. Have you researched form and control events?
    There are various free youtube videos discussing events and vba. Here's one.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    There's probably 4 or 5 events you might be inclined to use from some tutorial - especially if you don't read them through completely.
    For this, you'd want to use BeforeUpdate on the control, not the form, and cancel the event if the code doesn't pass the test. We can help if need be, as long as we know the control name and the logic that needs to be applied as the test. You should give it a shot - good learning experience.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Query Record Limits
    By Luvflt in forum Access
    Replies: 5
    Last Post: 04-30-2015, 11:02 AM
  2. PivotChart - LIMITS
    By cap.zadi in forum Forms
    Replies: 7
    Last Post: 11-29-2011, 02:17 AM
  3. Establishing Limits
    By Niki in forum Access
    Replies: 4
    Last Post: 04-07-2011, 12:01 PM
  4. Character Limits
    By nashr1928 in forum Reports
    Replies: 5
    Last Post: 12-08-2010, 01:29 PM
  5. Input limits
    By Hannu in forum Access
    Replies: 0
    Last Post: 08-31-2008, 03:02 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