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
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
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
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.
Thank you very much June7
I have very good job
Thanks burrina for help me