mao ni ko code ai....den i dont know pud if sakto bah sad kaha ni ang formula nako sa computation... d jud nako ma save. cge lang error.. basin naa mo mga suggesstions.. all i need is ma save then masakto na ang computation ani.... naa sad ni module.. ok ra ako module... tnx. sa mga mo help og suggestions.. god bless
option explicit
dim pay as currency
dim sss as currency
dim tax as currency
dim rate as currency
dim ot as currency
dim otrate as currency
dim deduc as currency
--------------------------------------------------------------------
private sub cmdsave_click()
call settable
pay = val(txtHWorked.text) * val(txtRPHour.text)
sss = pay * 0.02
tax = pay * 0.15
deduc - val(lblBasicPay.caption) * 0.3
lblSSS.caption = sss
lblBasicPay.caption = pay
lblTax.caption = tax
lblOTRate.caption = val(lblOTHours.caption) * (txtRPHour.text + (txtRPHour.text / 2))
lblTotalDeduc.caption = val (lblSSS.caption) + val(lblTax.caption) +val(txtdeduc.text)
lblNetPay.caption = val(lblBasicPay.caption) + val(lblOTRate.caption) - val(lblTotalDeduc.caption)
if checkID(txtID.text) then
msgbox " employee ID is not unique", vbcritical
elseif txtID.text = "" or txtName.text = "" or txtAddr.text = "" or txtDept.text = "" or txtHWorked.text = "" or txtRPHour.text = "" or txtDeduc.text = "" then
msgbox "please fill up all fields", vbcritical
elseif txtHWorked.text > 40 then
lblOTHours.caption = val(txtHWorked.text) - 40
else
rs.addnew
rs!empID = txtID.text
rs!empName = txtName.text
rs!empAddr = txtAddr.text
rs!empDept = txtDept.text
rs!empStatusRegProb = optPro.value and optReg.value
rs!empHWorked = txtHWorked.text
rs!empRPHour = val(txtRPHour.text)
rs!empDeduc = val(txtDeduc.text)
rs!empSSS = val(lblSSS.caption)
rs!empTax = val(lblTax.caption)
rs!empBasicPay = val(lblBasicPay.caption)
rs!empOTHours = val(lblOTHours.caption)
rs!empOTRate = val(lblOTRate.caption)
rs!empTotalDeduc = val(lblTOtalDeduc.caption)
rs!empNetPay = val(lblNetPay.caption)
rs.update
msgbox " new record added...",vbinformation
end if
end sub