Results 1 to 4 of 4
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528

    Percentage

    Hello guys
    How I do this. In a query, or a form directly?
    The amount from 1000 to 3000 5% will be deducted


    3001 to 6000 is subtract 8%
    Do you use an expression, or by using the function (Case)
    Thanks in advance

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    You could try this module and see if it works for you.
    modMakePerCentage
    Public Function MakePercent(txt As TextBox)
    On Error GoTo Err_Handler
    'Purpose: Divide the value by 100 if no percent sign found.
    'Usage: Set the After Update property of a text box named Text23 to:
    ' =MakePercent([Text23])


    If Not IsNull(txt) Then
    If InStr(txt.Text, "%") = 0 Then
    txt = txt / 100
    End If
    End If


    Exit_Handler:
    Exit Function


    Err_Handler:
    If Err.Number <> 2185 Then 'No Text property unless control has focus.
    MsgBox "Error " & Err.Number & " - " & Err.Description
    End If
    Resume Exit_Handler
    End Function


  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    An expression might serve.

    Discount: [field] * IIf([field] >= 1000 And [field] <= 3000, 0.05, IIf([field] > 3000 And [field] <= 6000, 0.08, 0))
    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.

  4. #4
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much June7
    I have very good job
    Thanks burrina for help me

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

Similar Threads

  1. Percentage calculation
    By CS_10 in forum Reports
    Replies: 36
    Last Post: 04-09-2014, 12:29 PM
  2. How to add percentage to number
    By azhar2006 in forum Queries
    Replies: 7
    Last Post: 03-19-2014, 11:19 PM
  3. Percentage Validation
    By abusaif in forum Access
    Replies: 9
    Last Post: 11-29-2013, 10:25 PM
  4. Return a Percentage
    By alecmat in forum Access
    Replies: 3
    Last Post: 08-07-2013, 08:06 PM
  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