Results 1 to 2 of 2
  1. #1
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150

    Setting A Maximum Value

    Click image for larger version. 
<br /><script async src=
    Name: 25686.jpg  Views: 13  Size: 35.8 KB  ID: 31787" class="thumbnail" style="float:CONFIG" />

    Hi Please See above Image.

    I have fields "Rate" and "Total_No_Of_Hours

    If Rate Exceeds Than 1000 it should come back to 1000 and if Total No Of Hours Exceeds 20 then is should come back to 20. How to do this?

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    First of all, change both fields to Number - Integer

    You haven't said where you want to do this.
    Various methods
    1. Set validation rules for the fields e.g. <=20
    2. Use If statements in vba e.g.
    Code:
    if rate>1000 then rate=1000
    3. Use intermediate if expression (IIf) to do the same thing in code or a query
    Code:
    Rate: Iif([Rate]>1000,1000,[Rate])
    Also don't use Date as a field name as it is a reserved word

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

Similar Threads

  1. Minimum & Maximum Row Value
    By Thompyt in forum Programming
    Replies: 8
    Last Post: 05-10-2016, 01:08 PM
  2. Need Help Setting a Maximum Number
    By kreelix in forum Access
    Replies: 3
    Last Post: 10-13-2015, 05:26 PM
  3. Maximum Nos of Records
    By abusaif in forum Access
    Replies: 2
    Last Post: 11-01-2014, 08:03 AM
  4. Maximum Questions
    By data808 in forum Access
    Replies: 4
    Last Post: 01-15-2014, 12:12 PM
  5. How do I return the maximum value
    By kam in forum Queries
    Replies: 2
    Last Post: 03-17-2010, 07:38 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