S
senkurion
I have a field called interest rate in table. Data in this table is in
percenatge I used following code ( which I got from Allen Browene ansewer to
similar qquestion in another post) I is not working for me please tell me
what is wrong with following code.
Code in module
Public Function MakePercent(Interest_rate)
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
Interest_rate to:
' =MakePercent([Interest_Rate])
If Not IsNull(Interest_rate) Then
If InStr(Interest_rate.Text, "%") = 0 Then
Interest_rate = (Interest_rate) / 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
and after update even of the text box is
=MakePercent([Interest_Rate])
but when i write this it says
expected: line number or label or statement or end of statement
i couldnot figureout waht is the problem
percenatge I used following code ( which I got from Allen Browene ansewer to
similar qquestion in another post) I is not working for me please tell me
what is wrong with following code.
Code in module
Public Function MakePercent(Interest_rate)
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
Interest_rate to:
' =MakePercent([Interest_Rate])
If Not IsNull(Interest_rate) Then
If InStr(Interest_rate.Text, "%") = 0 Then
Interest_rate = (Interest_rate) / 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
and after update even of the text box is
=MakePercent([Interest_Rate])
but when i write this it says
expected: line number or label or statement or end of statement
i couldnot figureout waht is the problem