Results 1 to 3 of 3
  1. #1
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171

    Percentage function in Form

    Hello,
    I have field1 (RequestedQty) and field2 (DeliveredQty) and in field3 I have status of completion in percent.
    I put the expression in field3 =[field1]/[field2]
    It is working but if the delivered quantity is zero then it showing error #div/0!. which is not looking good.
    So what expression we use in access for percentage.

    Secondly I want to restrict (Deliverdqty) according to (Requestedqty).


    Suppose we have 100 items in (Requestedqty). And if we want to enter 101 items in (Deliveredqty). It should not allowed.

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    =Nz([RequestedQty]/[DeliveredQty],0) 'Place this is Field 3 control source if it is unbound or else as Default Value

    That should fix the problem.
    If [Deliveredqty] > [Requestedqty] Then
    MsgBox "Access is Denied,You are Delivering More Than You Are Requesting"
    Me.Undo
    Exit Sub
    End If

    Place on the OnCurrentEvent of the form.Hope this helps.

  3. #3
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Thanks.
    It working fine.
    Problem Solved.

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

Similar Threads

  1. Calculating Percentage
    By robsworld78 in forum Forms
    Replies: 17
    Last Post: 07-03-2011, 06:30 PM
  2. Calculating a Percentage
    By Alaska1 in forum Access
    Replies: 7
    Last Post: 12-13-2010, 05:57 PM
  3. How to calculate a percentage on form
    By jrockusa in forum Forms
    Replies: 1
    Last Post: 03-31-2010, 01:53 PM
  4. Percentage Queries
    By bangemd in forum Queries
    Replies: 18
    Last Post: 05-21-2009, 09:32 AM
  5. percentage in a query
    By Peljo in forum Access
    Replies: 2
    Last Post: 02-27-2008, 10:51 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