Hi all
Yesterday one Sir had expaline me when to use and atvantage of module. Since then Im working hard to learn Module piece by piece. So I have written following code in the module for calculating the increase of salary (percentage wise base on current salary) and simuentaly to calculate total salary after increament. I need the result to be display in the form. bound.
Code written in module :
Public Function calculate(basic As Double, percent As Integer)
Dim totalAllowance As Double
Dim payAfterAllowance As Double
totalAllowance = (basic * percent / 100)
totalAllowance = (totalAllowance + basic)
End Function
Name given to each text boxes are:
For basic salary . text box name=textbasic
Textbox name inputing percentage=textallowancepercent
Texbox name for displaying allwoance amount= Texttotalallowance Texbox name for dispalyingTotal salary after allwoance= textpayafterallowance
Private Sub cmdcalculate_Click()
Texttotalallowance = calculate(textbasic) & (textallowancepercent)
textpayafterallowance = calculate(textbasic) & (textallowancepercent)
End Sub
When I click button (namecmdcalculate) it is not working. I get augumnet is not optional.
I request you all to throw light on this. whic i would appreciate la.
with regards.
Mr. sangpo
Yesterday one Sir had expaline me when to use and atvantage of module. Since then Im working hard to learn Module piece by piece. So I have written following code in the module for calculating the increase of salary (percentage wise base on current salary) and simuentaly to calculate total salary after increament. I need the result to be display in the form. bound.
Code written in module :
Public Function calculate(basic As Double, percent As Integer)
Dim totalAllowance As Double
Dim payAfterAllowance As Double
totalAllowance = (basic * percent / 100)
totalAllowance = (totalAllowance + basic)
End Function
Name given to each text boxes are:
For basic salary . text box name=textbasic
Textbox name inputing percentage=textallowancepercent
Texbox name for displaying allwoance amount= Texttotalallowance Texbox name for dispalyingTotal salary after allwoance= textpayafterallowance
Private Sub cmdcalculate_Click()
Texttotalallowance = calculate(textbasic) & (textallowancepercent)
textpayafterallowance = calculate(textbasic) & (textallowancepercent)
End Sub
When I click button (namecmdcalculate) it is not working. I get augumnet is not optional.
I request you all to throw light on this. whic i would appreciate la.
with regards.
Mr. sangpo